Skip to content

Expressions should also evaluate on statistics #992

@rdettai

Description

@rdettai

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Physical expressions should be aware of the rules on how to propagate statistics. For instance, for the row-wise max of two columns, the maximum statistics is the greatest of the maximum of the two input input columns. This would allow the ProjectionExec node to provide much better statistics.

Describe the solution you'd like
We should extend the PhysicalExpr trait with a method that handles statistics:

fn stats_eval(&self, stats: &Statitistics) -> Result<Statistics>

Describe alternatives you've considered
This could be implemented in the ProjectionExec with downcasting on various expression types.

Additional context
This is a follow up of #962

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions