Skip to content

regression in optimizing filter push down of CAST + BETWEEN #3863

Open

Description

@andygrove

Describe the bug

There has been a regression (since a92119a) in pushing BETWEEN expressions down to table scans.

before

Table scan filter: CAST(col1 AS Int64) BETWEEN Int64(4) AND Int64(4) + Int64(3)

after

Table scan filter: CAST(col1 AS Int64) >= Int64(4), CAST(col1 AS Int64) <= Int64(7)

Performing the CAST twice is not efficient.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

Activity

  1. alamb commented on Oct 18, 2022

    @alamb
    Contributor

    Thanks for the ticket @andygrove

    cc @liukun4515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoptimizerOptimizer rules

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions