[SPARK-56605][SQL] Wire resolution engine to use SQL PATH for table, function, and variable lookup #55523
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 406 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.359
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #55523"
general
weight: 0.35
vladimirg-db
What changes were proposed in this pull request?
Switch the resolution engine from the legacy single-schema
resolutionSearchPathtosqlResolutionPathEntriesonCatalogManager, so thatSET PATHactually affects how unqualified table names, function names, and variables are resolved.CatalogManager (
CatalogManager.scala):sqlResolutionPathEntries: ordered path entries for resolving unqualified names. When PATH is enabled and set, uses the stored session path; otherwise falls back todefaultPathOrder(legacy).sessionScopeUnqualifiedAllowed: gates unqualified variable access whensystem.sessionis not on the PATH.Relation resolution (
RelationResolution.scala):relationResolutionEntries/relationResolutionStepsreplacerelationResolutionSearchPath.PersistentCatalogStepcarries the catalog/namespace prefix so each path entry qualifies the object name under that entry.Function resolution (
FunctionResolution.scala):sqlResolutionPathEntriesForAnalysisprovides candidates for unqualified function names.resolveProcedure) moved here fromAnalyzer.Error context (
CheckAnalysis.scala):catalogPathForErrornow consultsAnalysisContext.catalogAndNamespacewhen inside a view body, so error messages report the view's defining catalog/namespace.UnresolvedTableOrViewSearchPathModeenum controls DDL vs query-like error paths.CatalogManagerconstants instead of string literals.RelationChangeserrors now include the search path.Variable resolution (
VariableResolution.scala+ callers):allowUnqualifiedSessionTempVariableLookupgates unqualified variable access whensystem.sessionis not on the PATH.Analyzer (
Analyzer.scala):sessionConfconstructor parameter for isolated analysis (e.g. Connect).resolutionConffor path-based resolution.AnalysisContext.resolutionPathEntriesfield (initiallyNone; frozen path wiring comes in follow-up PR).Single-pass resolver:
Resolver,HybridAnalyzer,NameScope,ResolverGuardaligned with new resolution signatures.Frozen path analysis for views/SQL functions (using stored path during analysis) comes in a follow-up PR. This PR only wires the resolution engine to use the live session path.
Why are the changes needed?
SET PATH(merged in SPARK-56501) stores the session path but the resolvers still used the legacy single-schema path. This PR completes the wiring so PATH actually affects resolution.Part of SPARK-54810.
Does this PR introduce _any_ user-facing change?
Yes. With
spark.sql.path.enabled = trueandSET PATH, unqualified table names, function names, and variable references now resolve according to the stored path order.How was this patch tested?
CI.
ProtoToParsedPlanTestSuiteupdated with analyzer isolation conf. Connect.explaingolden files updated.PlanResolutionSuite,NameScopeSuite,TimezoneAwareExpressionResolverSuiteupdated for new constructor signatures.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.6