This is an automated email from the ASF dual-hosted git repository.

maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 482a27c82fba [SPARK-50637][SQL] Fix code style for the single-pass 
Analyzer
482a27c82fba is described below

commit 482a27c82fbac46cde5a82d1e75cdb1811862d06
Author: Vladimir Golubev <[email protected]>
AuthorDate: Sun Dec 22 22:31:51 2024 +0300

    [SPARK-50637][SQL] Fix code style for the single-pass Analyzer
    
    ### 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 #49254 from 
vladimirg-db/vladimirg-db/single-pass-analyzer/fix-code-style.
    
    Authored-by: Vladimir Golubev <[email protected]>
    Signed-off-by: Max Gekk <[email protected]>
---
 .../catalyst/analysis/resolver/HybridAnalyzer.scala  |  6 +++---
 .../org/apache/spark/sql/internal/SQLConf.scala      | 20 +++++++++++---------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/HybridAnalyzer.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/HybridAnalyzer.scala
index 4ebcb3e06b17..039c07f5edbc 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/HybridAnalyzer.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/HybridAnalyzer.scala
@@ -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
@@ -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
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
index 306058fb3681..be883b2112d1 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
@@ -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")


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to