Introduce config to allow fail on fallback#12279
Open
felixloesing wants to merge 2 commits into
Open
Conversation
Adds `spark.gluten.sql.columnar.failOnFallback` (default false). When enabled, the query throws a GlutenException listing the operators and reasons whenever any operator falls back to Spark instead of running natively. We are rolling out Gluten to only queries that have been determined to be fully offloadable and use this config to guard against query changes after migration. GlutenFallbackReporter now drives both its log output and the SQL UI summary through a shared GlutenExplainUtils.visitFallbackNodes helper, so all three views (logs, UI, failOnFallback) agree on what counts as a fallback. As a side effect, untagged vanilla operators that were previously silent in the reporter logs are now reported with the reason "Gluten does not touch it or does not support it", matching what the SQL UI has always shown. - GlutenFallbackSuite: new fail job on fallback when failOnFallback is enabled test covers both default-off (no throw) and enabled (throws GlutenException mentioning the config key). - Existing fallback logging and event tests still pass. - Manual: run a query with an unsupported operator under failOnFallback=true and confirm the job fails with a useful operator/reason list.
|
Run Gluten Clickhouse CI on x86 |
philo-he
reviewed
Jun 11, 2026
| .doc( | ||
| "When true, throw an exception if any operator falls back to Spark" + | ||
| " instead of running on the native engine.") | ||
| .booleanConf |
Member
There was a problem hiding this comment.
Maybe add .internal() to mark this config as not intended for end users.
| } | ||
| } | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Since this test is independent of any Spark version, can we move it to the gluten-ut/test module—perhaps as a new test suite—so we only need to maintain a single copy of the test code?
Contributor
Author
There was a problem hiding this comment.
Thanks, @philo-he for your quick review! I addressed both of your comments. Please take another look.
|
Run Gluten Clickhouse CI on x86 |
Member
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.
What changes are proposed in this pull request?
Adds
spark.gluten.sql.columnar.failOnFallback(default false). When enabled, the query throws a GlutenException listing the operators and reasons whenever any operator falls back to Spark instead of running natively.We are rolling out Gluten to only queries that have been determined to be fully offloadable and use this config to guard against query changes after migration.
GlutenFallbackReporter now drives both its log output and the SQL UI summary through a shared GlutenExplainUtils.visitFallbackNodes helper, so all three views (logs, UI, failOnFallback) agree on what counts as a fallback. As a side effect, untagged vanilla operators that were previously silent in the reporter logs are now reported with the reason "Gluten does not touch it or does not support it", matching what the SQL UI has always shown.
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8