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 2022/10/28 03:47:33 UTC

[GitHub] [spark] LuciferYang commented on a diff in pull request #38413: [WIP][SPARK-40936][SQL][TESTS] Remove outer conditions to simplify `AnalysisTest#assertAnalysisErrorClass` method

LuciferYang commented on code in PR #38413:
URL: https://github.com/apache/spark/pull/38413#discussion_r1007582019


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala:
##########
@@ -716,9 +714,8 @@ class AnalysisSuite extends AnalysisTest with Matchers {
     assertAnalysisErrorClass(parsePlan("WITH t(x) AS (SELECT 1) SELECT * FROM t WHERE y = 1"),
       "UNRESOLVED_COLUMN.WITH_SUGGESTION",
       Map("objectName" -> "`y`", "proposal" -> "`t`.`x`"),
-      caseSensitive = true,
-      line = -1,
-      pos = -1)
+      Array(ExpectedContext("y", 46, 46))

Review Comment:
   https://github.com/apache/spark/blob/cf086b10de784fc92ae8b4d16065823ace520a7a/core/src/test/scala/org/apache/spark/SparkFunSuite.scala#L319-L332
   
   This change is due to the `checkError` method will perform a forced check when `actualQueryContext` is not empty. If we can to relax some check conditions,  can add a precondition `queryContext.nonEmpty` for the `queryContext` check.



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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