Skip to content

Commit

Permalink
[SPARK-50637][SQL] Fix code style for the single-pass Analyzer
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Fix some nits that were left out from the initial single-pass Analyzer review.

### Why are the changes needed?

To make code style better.

### Does this PR introduce _any_ user-facing change?

 No.

### How was this patch tested?

Existing tests.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#49254 from vladimirg-db/vladimirg-db/single-pass-analyzer/fix-code-style.

Authored-by: Vladimir Golubev <vladimir.golubev@databricks.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
  • Loading branch information
vladimirg-db authored and MaxGekk committed Dec 22, 2024
1 parent a2e3188 commit 482a27c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ class HybridAnalyzer(
}
}

private def checkResolverGuard(plan: LogicalPlan): Boolean =
!checkSupportedSinglePassFeatures || resolverGuard.apply(plan)

def getSinglePassResolutionDuration: Option[Long] = singlePassResolutionDuration

def getFixedPointResolutionDuration: Option[Long] = fixedPointResolutionDuration
Expand Down Expand Up @@ -218,6 +215,9 @@ class HybridAnalyzer(
NormalizePlan(plan)
}

private def checkResolverGuard(plan: LogicalPlan): Boolean =
!checkSupportedSinglePassFeatures || resolverGuard.apply(plan)

private def recordDuration[T](thunk: => T): (Long, T) = {
val start = System.nanoTime()
val res = thunk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,17 @@ object SQLConf {
.booleanConf
.createWithDefault(false)

val ANALYZER_DUAL_RUN_LEGACY_AND_SINGLE_PASS_RESOLVER =
buildConf("spark.sql.analyzer.singlePassResolver.dualRunWithLegacy")
.internal()
.doc("When true, run both analyzers to check if single-pass Analyzer correctly produces" +
" the same analyzed plan as the fixed-point Analyzer for the existing set of features" +
" defined in the ResolverGuard")
.version("4.0.0")
.booleanConf
.createWithDefault(false)
val ANALYZER_DUAL_RUN_LEGACY_AND_SINGLE_PASS_RESOLVER =
buildConf("spark.sql.analyzer.singlePassResolver.dualRunWithLegacy")
.internal()
.doc(
"When true, run both analyzers to check if single-pass Analyzer correctly produces " +
"the same analyzed plan as the fixed-point Analyzer for the existing set of features " +
"defined in the ResolverGuard"
)
.version("4.0.0")
.booleanConf
.createWithDefault(false)

val ANALYZER_SINGLE_PASS_RESOLVER_VALIDATION_ENABLED =
buildConf("spark.sql.analyzer.singlePassResolver.validationEnabled")
Expand Down

0 comments on commit 482a27c

Please sign in to comment.