[SPARK-55983][SQL][FOLLOWUP] New single-pass analyzer functionality and bugfixes#54881
Open
mihailotim-db wants to merge 2 commits intoapache:masterfrom
Open
[SPARK-55983][SQL][FOLLOWUP] New single-pass analyzer functionality and bugfixes#54881mihailotim-db wants to merge 2 commits intoapache:masterfrom
mihailotim-db wants to merge 2 commits intoapache:masterfrom
Conversation
…tabricks Runtime Port additional single-pass resolver components from Databricks Runtime to OSS Spark, expanding the resolver package with new operator and expression resolvers. This includes support for pivot/unpivot, higher-order functions, lambda functions, table-valued functions, extract values, grouping analytics, repartition-by-expression, name-parameterized queries, and logical plan diffing infrastructure. Co-authored-by: Isaac
The test expected IllegalArgumentException for a negative config value, but the config key doesn't have that validation in OSS (it was a DatabricksSQLConf check). Co-authored-by: Isaac
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 ports additional single-pass resolver components from Databricks Runtime to OSS Spark, expanding the resolver package with new operator and expression
resolvers.
New resolver files (14):
PivotResolver- ResolvesPivotoperatorsUnpivotResolver- ResolvesUnpivotoperatorsHigherOrderFunctionResolver- Resolves higher-order functions (e.g.,transform,filter,aggregate)LambdaFunctionResolver- Resolves lambda functions used in higher-order functionsTableValuedFunctionResolver- Resolves table-valued functionsExtractValueResolver- ResolvesUnresolvedExtractValue(array/map indexing)GroupingAnalyticsResolver- Resolves grouping analytics expressions (GROUPING SETS,CUBE,ROLLUP)RepartitionByExpressionResolver- ResolvesRepartitionByExpressionoperatorsNameParameterizedQueryResolver- Resolves name-parameterized queriesFunctionResolverUtils- Shared utilities for function resolution (star expansion in function args)IdentifierFromUnresolvedNodeExtractor- Extracts identifiers from unresolved nodesLogicalPlanDifference- Infrastructure for diffing logical plans (used in dual-run validation)RecursiveCteState- State tracking for recursive CTE resolutionResolverRunnerResult- Result type for resolver runnerModified existing files (4):
ExpressionResolver- AddedexpandStarExpressions,resolvePivotAggregates,resolveUnpivotArgumentsmethodsExpressionResolutionContext- AddedresolvingPivotAggregates,hasGroupingAnalyticsExpression,extractValueExtractionKey,lambdaVariableMapfieldsNameScope- AddedmarkScopeForHiddenOutputResolution()methodFunctionResolution- AddedresolveBuiltinOrTempFunction,resolveTableValuedFunctionmethodsNew test file (1):
LogicalPlanDifferenceSuiteWhy are the changes needed?
The single-pass resolver is an alternative to the traditional fixed-point (iterative) analyzer that resolves SQL plans in a single bottom-up traversal. These
changes bring additional operator coverage to the OSS single-pass resolver, closing the gap between the Databricks Runtime implementation and the open-source
version. Without these resolvers, queries involving pivot/unpivot, higher-order functions, table-valued functions, grouping analytics, and other constructs would
fall back to the legacy fixed-point analyzer.
Does this PR introduce any user-facing change?
No. The single-pass resolver is gated behind configuration flags and these changes only expand internal resolver coverage.
How was this patch tested?
catalyst/compile,sql/compile,catalyst/Test/compile, andsql/Test/compileall pass cleanly.LogicalPlanDifferenceSuitefor the newLogicalPlanDifferenceinfrastructure.ResolverSuite,HybridAnalyzerSuite,ResolverGuardSuite, etc.) continue to compile and are unaffected by these changes.Was this patch authored or co-authored using generative AI tooling?