Skip to content

Optimize the evaluation of date_part(<col>) == <constant> when pushed down #19889

@sdf-jkl

Description

@sdf-jkl

Is your feature request related to a problem or challenge?

Now that we support preimage evaluation we should implement it for udfs to enable predicate pruning.

For example the predicate looking for a particular year

WHERE EXTRACT (YEAR FROM k) = 2024

Can be rewritten as

k >= 2024-01-01 AND k < 2025-01-01.

And then k is easier to pushdown and subject to range analysis, etc.

Describe the solution you'd like

Implement preimage for date_part udf and add sqllogictests.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions