bersprockets opened a new pull request, #52128:
URL: https://github.com/apache/spark/pull/52128

   ### What changes were proposed in this pull request?
   
   Don't include a query where a build-side key is a string used in a numeric 
expression.
   
   ### Why are the changes needed?
   
   In non-ansi mode, casting of the string `t2.c1` to use in a numeric 
expression (`t2.c1 * 1000`) adds extra scaffolding around that expression in 
the build keys, but not in the condition. In the condition, `t2.c1 * 1000` is 
   
   `(cast(c1#299 as double) * 1000.0`
   
   but in the build key, it is
   
   `knownfloatingpointnormalized(normalizenanandzero((cast(c1#299 as double) * 
1000.0)`
   
   As a result, `t2.c1 * 1000` doesn't match between the build  keys and the 
condition. Therefore, the optimization is not performed, and since the test 
checks for the optimization, the test fails in non-ansi mode.
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Manually ran the offending test both with and without 
`SPARK_ANSI_SQL_MODE=false`.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to