Skip to content

[Optimizer] Function to pushable ops #2639

@joocer

Description

@joocer

Summary

The expression EXTRACT(YEAR FROM x) = n is not currently pushable, which results in a full table scan even when the filter is selective. We should rewrite this filter into an equivalent range predicate that can be pushed to the storage engine.

Example

Before (unpushable):

SELECT *
FROM data.missions
WHERE EXTRACT(YEAR FROM launch_date) = 2020;

After (pushable)

SELECT *
FROM data.missions
WHERE launch_date >= DATE '2020-01-01'
  AND launch_date <  DATE '2021-01-01';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions