ExprSimplifier::coerce
limits the applicability of containment PruningPredicate
s (
LiteralGuarantee::analyze`)
#13244
Labels
enhancement
New feature or request
Is your feature request related to a problem or challenge?
I am trying to use
PruningPredicate
s.The expressions require coercion
ExprSimplifier::coerce
before it can be evaluated, so we run [simplify
,coerce
,simplify
,create_physical_expr
,PruningPredicate::try_new
].If the expression being considered (with schema) is:
Col('y', Int32) = Lit(Int64(5))
then the resulting expression will be.Then when
PruningPredicate
analysis is run theLiteralGuarantee::analyze
will not find anyLiteralGuarantee
s and therefore pruning will safely assume that nothing can be pruned.However if the expression is
Col('y', Int32) = Lit(Int32(5))
, no cast will be included and pruning will work as indented.Describe the solution you'd like
Either:
LiteralGuarantee::analyze
to understandCast
ingExprSimplifier::coerce
to safely downcast Literals (inLit <op> Col
) to the column type if possibleLit(Int64(2)) -> Lit(Int16(2))
.Describe alternatives you've considered
No response
Additional context
Relevant issues: #8302
The text was updated successfully, but these errors were encountered: