[SPARK-56596][SQL] Enable dual runs for single-pass analyzer#55447
Open
mihailotim-db wants to merge 1 commit intoapache:masterfrom
Open
[SPARK-56596][SQL] Enable dual runs for single-pass analyzer#55447mihailotim-db wants to merge 1 commit intoapache:masterfrom
mihailotim-db wants to merge 1 commit intoapache:masterfrom
Conversation
Member
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Please create a JIRA issue and use it in the PR title before converting this back to a normal PR.
e5f82c7 to
978050b
Compare
978050b to
9c815d6
Compare
0c779a7 to
af467f2
Compare
af467f2 to
39cc5a9
Compare
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 were proposed in this pull request?
This PR enables single-pass analyzer dual runs in testing mode and adds the infrastructure to control dual-run behavior.
Background: How dual runs work
The
HybridAnalyzersits between the SQL parser and the rest of the query planning pipeline. When dual-run mode is enabled, every query goes throughthe following flow:
ResolverGuardinspects the unresolved logical plan to check whether all operators and expressions are supported by the single-pass resolver.If any unsupported feature is detected, the query skips dual-run entirely and uses the legacy fixed-point analyzer only.
view resolutions) is captured in the
AnalyzerBridgeState.BridgedRelationMetadataProviderto reuse the relation metadata fromstep 2, avoiding duplicate catalog RPCs.
ANALYZER_LOG_ERRORS_INSTEAD_OF_THROWING_IN_DUAL_RUNS: in testsit throws (to catch regressions), in production it logs and returns the fixed-point result.
ExplicitlyUnsupportedResolverFeature, the fixed-point result is returned silently (this is expected for features notyet ported to the resolver).
ANALYZER_DUAL_RUN_RETURN_SINGLE_PASS_RESULTdefaults tofalse).Why are the changes needed?
Dual runs are the primary mechanism for validating single-pass analyzer correctness against the legacy fixed-point analyzer. Enabling them by default
in tests ensures that any regressions in single-pass resolution are caught immediately during development, rather than discovered later in production.
Does this PR introduce any user-facing change?
No. All changes are internal and only affect test-time behavior. The
ANALYZER_LOG_ERRORS_INSTEAD_OF_THROWING_IN_DUAL_RUNSconfig defaults totrueoutside of tests, so production behavior is unchanged.
How was this patch tested?
Existing tests (
SQLQueryTestSuiteand others). The dual-run mode validates single-pass results against fixed-point results on every query executedduring tests.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-6)