You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/20 18:26:18 UTC

[GitHub] [spark] yuningzh-db opened a new pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

yuningzh-db opened a new pull request #30108:
URL: https://github.com/apache/spark/pull/30108


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714808182






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on a change in pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #30108:
URL: https://github.com/apache/spark/pull/30108#discussion_r509797389



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
##########
@@ -926,4 +926,43 @@ class AnalysisSuite extends AnalysisTest with Matchers {
     )
     assertAnalysisSuccess(plan)
   }
+
+  test("SPARK-33197: Make sure changes to ANALYZER_MAX_ITERATIONS take effect at runtime") {
+    // RuleExecutor only throw exception or log warning when the rule is supposed to run
+    // more than once.
+    val maxIterations = 2
+    val maxIterationsEnough = 5
+    val conf = new SQLConf().copy(SQLConf.ANALYZER_MAX_ITERATIONS -> maxIterations)
+    val testAnalyzer = new Analyzer(
+      new SessionCatalog(new InMemoryCatalog, FunctionRegistry.builtin, conf), conf)
+
+    val plan = testRelation2.select(
+      $"a" / Literal(2) as "div1",
+      $"a" / $"b" as "div2",
+      $"a" / $"c" as "div3",
+      $"a" / $"d" as "div4",
+      $"e" / $"e" as "div5")
+
+    val message1 = intercept[TreeNodeException[LogicalPlan]] {
+      testAnalyzer.execute(plan)
+    }.getMessage
+    assert(message1.startsWith(s"Max iterations ($maxIterations) reached for batch Resolution, " +
+      s"please set '${SQLConf.ANALYZER_MAX_ITERATIONS.key}' to a larger value."))
+
+    conf.setConfString(SQLConf.ANALYZER_MAX_ITERATIONS.key, maxIterationsEnough.toString)

Review comment:
       Could you use `withSQLConf` instead?

##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
##########
@@ -926,4 +926,43 @@ class AnalysisSuite extends AnalysisTest with Matchers {
     )
     assertAnalysisSuccess(plan)
   }
+
+  test("SPARK-33197: Make sure changes to ANALYZER_MAX_ITERATIONS take effect at runtime") {
+    // RuleExecutor only throw exception or log warning when the rule is supposed to run
+    // more than once.
+    val maxIterations = 2
+    val maxIterationsEnough = 5
+    val conf = new SQLConf().copy(SQLConf.ANALYZER_MAX_ITERATIONS -> maxIterations)
+    val testAnalyzer = new Analyzer(
+      new SessionCatalog(new InMemoryCatalog, FunctionRegistry.builtin, conf), conf)
+
+    val plan = testRelation2.select(
+      $"a" / Literal(2) as "div1",
+      $"a" / $"b" as "div2",
+      $"a" / $"c" as "div3",
+      $"a" / $"d" as "div4",
+      $"e" / $"e" as "div5")
+
+    val message1 = intercept[TreeNodeException[LogicalPlan]] {
+      testAnalyzer.execute(plan)
+    }.getMessage
+    assert(message1.startsWith(s"Max iterations ($maxIterations) reached for batch Resolution, " +
+      s"please set '${SQLConf.ANALYZER_MAX_ITERATIONS.key}' to a larger value."))
+
+    conf.setConfString(SQLConf.ANALYZER_MAX_ITERATIONS.key, maxIterationsEnough.toString)
+    try {
+      testAnalyzer.execute(plan)
+    } catch {
+      case ex: TreeNodeException[_]
+        if ex.getMessage.contains(SQLConf.ANALYZER_MAX_ITERATIONS.key) =>
+          fail("analyzer.execute should not reach max iterations.")
+    }
+
+    conf.setConfString(SQLConf.ANALYZER_MAX_ITERATIONS.key, maxIterations.toString)

Review comment:
       ditto




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713226067


   **[Test build #130062 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130062/testReport)** for PR 30108 at commit [`27cb500`](https://github.com/apache/spark/commit/27cb5004711d21d4d8f33f0194207811897f6932).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713767268


   **[Test build #130100 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130100/testReport)** for PR 30108 at commit [`26a56ef`](https://github.com/apache/spark/commit/26a56efaecfa81cc75a87e3ee26566e3aa3b7b27).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713916144


   **[Test build #130100 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130100/testReport)** for PR 30108 at commit [`26a56ef`](https://github.com/apache/spark/commit/26a56efaecfa81cc75a87e3ee26566e3aa3b7b27).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] yuningzh-db commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
yuningzh-db commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714700858


   Yes. It is the same behavior as `Optimizer`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713767268


   **[Test build #130100 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130100/testReport)** for PR 30108 at commit [`26a56ef`](https://github.com/apache/spark/commit/26a56efaecfa81cc75a87e3ee26566e3aa3b7b27).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713815901






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-716358335


   Thanks! Merged to master/3.0.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714717856






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713313077






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713815880


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34709/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714705934


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34780/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713241056


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34672/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714717835


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34780/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714681241


   **[Test build #130174 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130174/testReport)** for PR 30108 at commit [`972c344`](https://github.com/apache/spark/commit/972c3447f66ea810ca73fd0a27d3fad25cc45059).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713055150


   Can one of the admins verify this patch?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713917504






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713313077






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714808182






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] yuningzh-db commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
yuningzh-db commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713801004


   I just confirmed this issue can also happen in branch-3.0


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714202893


   what's the cost here? does it mean we need to re-create the rule/batch instances every time we run a query?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on a change in pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #30108:
URL: https://github.com/apache/spark/pull/30108#discussion_r509798340



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -206,7 +200,7 @@ class Analyzer(
    */
   val postHocResolutionRules: Seq[Rule[LogicalPlan]] = Nil
 
-  lazy val batches: Seq[Batch] = Seq(
+  def batches: Seq[Batch] = Seq(

Review comment:
       nit: could you add `override` here? https://github.com/databricks/scala-style-guide#override-modifier




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714807511


   **[Test build #130174 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130174/testReport)** for PR 30108 at commit [`972c344`](https://github.com/apache/spark/commit/972c3447f66ea810ca73fd0a27d3fad25cc45059).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on a change in pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #30108:
URL: https://github.com/apache/spark/pull/30108#discussion_r509262011



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
##########
@@ -782,10 +783,26 @@ class AnalysisSuite extends AnalysisTest with Matchers {
       $"a" / $"d" as "div4",
       $"e" / $"e" as "div5")
 
-    val message = intercept[TreeNodeException[LogicalPlan]] {
+    val message1 = intercept[TreeNodeException[LogicalPlan]] {
       testAnalyzer.execute(plan)
     }.getMessage
-    assert(message.startsWith(s"Max iterations ($maxIterations) reached for batch Resolution, " +
+    assert(message1.startsWith(s"Max iterations ($maxIterations) reached for batch Resolution, " +
+      s"please set '${SQLConf.ANALYZER_MAX_ITERATIONS.key}' to a larger value."))
+
+    conf.setConfString(SQLConf.ANALYZER_MAX_ITERATIONS.key, maxIterationsEnough.toString)

Review comment:
       Could you add a new test unit with the prefix `test("SPARK-33197 ...` instead of modifying the existing test?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713312375


   **[Test build #130062 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130062/testReport)** for PR 30108 at commit [`27cb500`](https://github.com/apache/spark/commit/27cb5004711d21d4d8f33f0194207811897f6932).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713248699






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713248689


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34672/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] yuningzh-db commented on a change in pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
yuningzh-db commented on a change in pull request #30108:
URL: https://github.com/apache/spark/pull/30108#discussion_r511049304



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
##########
@@ -926,4 +926,45 @@ class AnalysisSuite extends AnalysisTest with Matchers {
     )
     assertAnalysisSuccess(plan)
   }
+
+  test("SPARK-33197: Make sure changes to ANALYZER_MAX_ITERATIONS take effect at runtime") {
+    // RuleExecutor only throw exception or log warning when the rule is supposed to run
+    // more than once.
+    val maxIterations = 2
+    val maxIterationsEnough = 5
+    withSQLConf(SQLConf.ANALYZER_MAX_ITERATIONS.key -> maxIterations.toString) {
+      val conf = SQLConf.get
+      val testAnalyzer = new Analyzer(
+        new SessionCatalog(new InMemoryCatalog, FunctionRegistry.builtin, conf), conf)
+
+      val plan = testRelation2.select(
+        $"a" / Literal(2) as "div1",
+        $"a" / $"b" as "div2",
+        $"a" / $"c" as "div3",
+        $"a" / $"d" as "div4",
+        $"e" / $"e" as "div5")
+
+      val message1 = intercept[TreeNodeException[LogicalPlan]] {
+        testAnalyzer.execute(plan)
+      }.getMessage
+      assert(message1.startsWith(s"Max iterations ($maxIterations) reached for batch Resolution, " +
+        s"please set '${SQLConf.ANALYZER_MAX_ITERATIONS.key}' to a larger value."))
+
+      withSQLConf(SQLConf.ANALYZER_MAX_ITERATIONS.key -> maxIterationsEnough.toString) {
+        try {
+          testAnalyzer.execute(plan)
+        } catch {

Review comment:
       I want to make it explicit that this line should not trigger exception.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713225634


   ok to test


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714011635


   Looks okay otherwise, cc: @HyukjinKwon @cloud-fan 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713800315


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34709/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713815901






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713248699






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713054312


   Can one of the admins verify this patch?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714681241


   **[Test build #130174 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130174/testReport)** for PR 30108 at commit [`972c344`](https://github.com/apache/spark/commit/972c3447f66ea810ca73fd0a27d3fad25cc45059).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30108:
URL: https://github.com/apache/spark/pull/30108#discussion_r510628863



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
##########
@@ -926,4 +926,45 @@ class AnalysisSuite extends AnalysisTest with Matchers {
     )
     assertAnalysisSuccess(plan)
   }
+
+  test("SPARK-33197: Make sure changes to ANALYZER_MAX_ITERATIONS take effect at runtime") {
+    // RuleExecutor only throw exception or log warning when the rule is supposed to run
+    // more than once.
+    val maxIterations = 2
+    val maxIterationsEnough = 5
+    withSQLConf(SQLConf.ANALYZER_MAX_ITERATIONS.key -> maxIterations.toString) {
+      val conf = SQLConf.get
+      val testAnalyzer = new Analyzer(
+        new SessionCatalog(new InMemoryCatalog, FunctionRegistry.builtin, conf), conf)
+
+      val plan = testRelation2.select(
+        $"a" / Literal(2) as "div1",
+        $"a" / $"b" as "div2",
+        $"a" / $"c" as "div3",
+        $"a" / $"d" as "div4",
+        $"e" / $"e" as "div5")
+
+      val message1 = intercept[TreeNodeException[LogicalPlan]] {
+        testAnalyzer.execute(plan)
+      }.getMessage
+      assert(message1.startsWith(s"Max iterations ($maxIterations) reached for batch Resolution, " +
+        s"please set '${SQLConf.ANALYZER_MAX_ITERATIONS.key}' to a larger value."))
+
+      withSQLConf(SQLConf.ANALYZER_MAX_ITERATIONS.key -> maxIterationsEnough.toString) {
+        try {
+          testAnalyzer.execute(plan)
+        } catch {

Review comment:
       do we need a try catch here? Shall we just run `testAnalyzer.execute(plan)` and make sure it doesn't fail?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713917504






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713560023


   This issue can also happen in branch-3.0? I found that you only set `Affects Version/s` to 3.1.0 though.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-714717856






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713226067


   **[Test build #130062 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/130062/testReport)** for PR 30108 at commit [`27cb500`](https://github.com/apache/spark/commit/27cb5004711d21d4d8f33f0194207811897f6932).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713055150


   Can one of the admins verify this patch?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30108:
URL: https://github.com/apache/spark/pull/30108#issuecomment-713054312


   Can one of the admins verify this patch?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu closed pull request #30108: [SPARK-33197][SQL] Make changes to spark.sql.analyzer.maxIterations take effect at runtime

Posted by GitBox <gi...@apache.org>.
maropu closed pull request #30108:
URL: https://github.com/apache/spark/pull/30108


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org