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/14 17:17:48 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #38256: [SPARK-39783][SQL] Fix backticks for column candidates in error message

MaxGekk commented on code in PR #38256:
URL: https://github.com/apache/spark/pull/38256#discussion_r995973164


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisErrorSuite.scala:
##########
@@ -876,6 +876,24 @@ class AnalysisErrorSuite extends AnalysisTest {
       "[`a`, `b`, `c`, `d`, `e`]"
       :: Nil)
 
+  errorTest(

Review Comment:
   Could you invoke `errorClassTest()`. This will allow to make the test independent from error message text, so, tech editors could edit `error-classes.json` and don't depend on Spark's tests.



##########
sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala:
##########
@@ -1992,6 +1992,33 @@ class DatasetSuite extends QueryTest
     }
   }
 
+  test("SPARK-39783: Fix error messages for columns with dots/periods") {
+    forAll(dotColumnTestModes) { (caseSensitive, colName) =>
+      val ds = Seq(SpecialCharClass("1", "2")).toDS
+      withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive) {
+        val errorMsg = intercept[AnalysisException] {
+          // Note: ds(colName) has different semantics than ds.select(colName)
+          ds.select(colName)
+        }
+        assert(errorMsg.getMessage.contains(

Review Comment:
   Please, use `checkError()`.



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