andygrove opened a new pull request, #4773:
URL: https://github.com/apache/datafusion-comet/pull/4773

   ## Which issue does this PR close?
   
   Closes #3340.
   
   ## Rationale for this change
   
   Issue #3340 reported that an all-literal `sha2()` call (reached when Spark's 
`ConstantFolding` optimizer rule is disabled) crashed the native engine with 
`Unsupported argument types for sha2 function`. That crash came from Comet's 
own `sha2` implementation, which has since been removed in favor of 
`datafusion-spark`'s `SparkSha2` (PR #2063). The upstream implementation 
explicitly handles the all-scalar `(Scalar, Scalar)` case, so the crash no 
longer occurs. This PR removes the now-stale workaround and adds regression 
coverage so the scenario stays fixed.
   
   ## What changes are included in this PR?
   
   - Remove the `ignore(#3340)` directive on the literal-arguments query in 
`expressions/hash/hash.sql`, enabling it again. The SQL file test suite already 
disables `ConstantFolding` globally, so this query exercises the exact reported 
scenario. The query is also extended to cover all `sha2` bit lengths (0, 224, 
256, 384, 512), an unsupported bit length (128), a negative bit length (-1), 
and a null input.
   - Add a focused Scala regression test in `CometExpressionSuite` that 
disables `ConstantFolding` and runs all-literal `sha2()` calls across the same 
bit lengths.
   
   ## How are these changes tested?
   
   Both tests run all-literal `sha2()` through the native engine with 
`ConstantFolding` disabled and assert the result matches Spark via 
`checkSparkAnswerAndOperator`:
   
   - `CometSqlFileTestSuite` -> `sql-file: expressions/hash/hash.sql`
   - `CometExpressionSuite` -> `sha2 with all-literal arguments and 
ConstantFolding disabled`
   


-- 
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