You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support casting expressions in pruning logic #3377
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Sometimes predicates include casts. Some of these casts are optimized away during query planning, but some can not be.
A practical example of such a cast might be this query to look for data 4 days in the past
While this particular query will likely be cleaned up into nicer things like (now() - time) < interval '4 days' as we fill out the time / date functionality, the pattern will still persist if we have things like
cast(int_col) asDecimal(19,5) <123.45
Thus, it is important to support the cast during the evaluation of the pruning predicate
Describe the solution you'd like
I would like the expression prunning logic(PruningPredicate) to handle expressions such as
cast(timeasbigint) <3600
Note that since the pruning logic is based on comparing min/max values, we must be careful that any casts we apply preserve order. For example, casts from numbers <--> string are likely not correct
Describe alternatives you've considered
N/A
Additional context
Add any other context or screenshots about the feature request here.
Activity
alamb commentedon Sep 8, 2022
This may be more important as we move more casting to the logical plan (e.g. #3222 )