ggjh-159 commented on code in PR #13484:
URL: https://github.com/apache/gluten/pull/13484#discussion_r4412459180


##########
gluten-flink/planner/src/main/java/org/apache/gluten/rexnode/functions/RexCallConverterFactory.java:
##########
@@ -108,6 +108,14 @@ public class RexCallConverterFactory {
           Map.entry(
               "REGEXP_EXTRACT", Arrays.asList(() -> new 
DefaultRexCallConverter("regexp_extract"))),
           Map.entry("LOWER", Arrays.asList(() -> new 
DefaultRexCallConverter("lower"))),
+          // Direct name mapping: the SHA-2 family. The fixed-length spellings
+          // are the sha2 core with the length bound on the velox side; the
+          // hashLength operand is routed by the velox sha2 signature set.
+          Map.entry("SHA2", Arrays.asList(() -> new 
DefaultRexCallConverter("sha2"))),

Review Comment:
   Scenario: `SHA2(s, 0)` where 0 is a constant, and the input is an empty 
table (or `s` is all NULL). Flink fails this job even with zero rows: the 
constant length is checked in the generated operator's constructor 
(StringCallGen.scala:644 → CodeGeneratorContext.scala:1054-1056), which throws 
`Unsupported algorithm.` for 0 regardless of input. GFV succeeds and returns 
NULLs: the length check runs per row in velox, and an empty/all-NULL input 
never evaluates a row. Please validate a constant hashLength ∈ {224, 256, 384, 
512} at conversion time in the SHA2 converter and fail the conversion 
otherwise; NULL constants and column references keep the existing runtime 
rejection, matching Flink. Add conversion tests (constant 0/385 fail to 
convert; valid and NULL constants still convert) and update 
testSha2LiteralZeroLengthPassesThrough, which currently pins constant-0 
pass-through.



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