luluorta commented on a change in pull request #30289: URL: https://github.com/apache/spark/pull/30289#discussion_r530130052
########## File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala ########## @@ -771,22 +771,24 @@ class AnalysisSuite extends AnalysisTest with Matchers { // RuleExecutor only throw exception or log warning when the rule is supposed to run // more than once. val maxIterations = 2 - 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 message = intercept[TreeNodeException[LogicalPlan]] { - testAnalyzer.execute(plan) - }.getMessage - assert(message.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 -> maxIterations.toString) { + val conf = new SQLConf().copy(SQLConf.ANALYZER_MAX_ITERATIONS -> maxIterations) 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org