minni31 opened a new pull request, #11854: URL: https://github.com/apache/gluten/pull/11854
## Summary Enables ANSI mode handling for cast operations from numeric types (int, long, float, double) to integral types (tinyint, smallint, integer, bigint) in the Velox backend. When `spark.sql.ansi.enabled=true`, CAST from numeric to integral types now throws on overflow instead of silently wrapping/truncating, matching Spark's [ANSI compliance](https://spark.apache.org/docs/latest/sql-ref-ansi-compliance.html). **Depends on Velox PR**: https://github.com/facebookincubator/velox/pull/16962 ## Changes ### C++ (Velox backend config) - **VeloxConfig.h**: Add `spark.sql.ansi.enabled` config key - **WholeStageResultIterator.cc**: Propagate ANSI config to Velox QueryConfig ### Scala/Java (Substrait conversion) - **CastNode.java**: Use int `failureBehavior` (0=UNSPECIFIED, 1=RETURN_NULL, 2=THROW_EXCEPTION) instead of boolean `isTryCast` - **ExpressionBuilder.java**: Add `makeCast` overload with `isAnsiCast` param - **UnaryExpressionTransformer.scala**: Pass `withAnsiEvalMode` to CastTransformer ### Shims - **Spark34/35/40Shims.scala**: Add `Cast` to `withAnsiEvalMode` pattern matching ### Tests - **VeloxTestSettings.scala** (spark34/35/40): Remove exclusions for 4 ANSI cast overflow tests - **GlutenTryCastSuite.scala**: Enable ANSI overflow tests ## Testing - GlutenTryCastSuite: 78/78 tests passed, 0 failures -- 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]
