[VL] Add ANSI mode support for Spark CAST(NumericType as integral)#11854
Open
minni31 wants to merge 2 commits intoapache:mainfrom
Open
[VL] Add ANSI mode support for Spark CAST(NumericType as integral)#11854minni31 wants to merge 2 commits intoapache:mainfrom
minni31 wants to merge 2 commits intoapache:mainfrom
Conversation
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. Changes: - VeloxConfig.h: Add spark.sql.ansi.enabled config key - WholeStageResultIterator.cc: Propagate ANSI config to Velox QueryConfig - 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 - Spark34/35/40Shims.scala: Add Cast to withAnsiEvalMode pattern matching - VeloxTestSettings.scala: Remove exclusions for ANSI cast overflow tests - GlutenTryCastSuite.scala: Enable ANSI overflow tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Depends on Velox PR: facebookincubator/velox#16962
Changes
C++ (Velox backend config)
spark.sql.ansi.enabledconfig keyScala/Java (Substrait conversion)
failureBehavior(0=UNSPECIFIED, 1=RETURN_NULL, 2=THROW_EXCEPTION) instead of booleanisTryCastmakeCastoverload withisAnsiCastparamwithAnsiEvalModeto CastTransformerShims
CasttowithAnsiEvalModepattern matchingTests
Testing