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
PreCastLitInComparisonExpressions should use ExprRewriter and supported nested expressions #3259
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
PreCastLitInComparisonExpressions does not use ExprRewriter so does not support some nested expressions, such as aliased expressions.
Failing test to demonstrate the issue. It works if the aliases are removed.
#[test]fnnested(){let schema = expr_test_schema();// c1 < INT64(16) -> c1 < cast(INT32(16))// the 16 is within the range of MAX(int32) and MIN(int32), we can cast the 16 to int32(16)let expr_lt = col("c1").lt(lit(ScalarValue::Int64(Some(16)))).alias("x");let expected = col("c1").lt(lit(ScalarValue::Int32(Some(16)))).alias("x");assert_eq!(optimize_test(expr_lt,&schema), expected);}
Describe the solution you'd like
Use ExprRewriter and support nested expressions.
Activity