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/02/08 07:49:06 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #35433: [SPARK-38097][SQL][TESTS] Update the error message of checkUnsupportedTypeInLiteral

MaxGekk commented on a change in pull request #35433:
URL: https://github.com/apache/spark/pull/35433#discussion_r801342538



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala
##########
@@ -121,7 +121,8 @@ class QueryExecutionErrorsSuite extends QueryTest with SharedSparkSession {
       val e1 = intercept[SparkRuntimeException] { lit(v) }
       assert(e1.getErrorClass === "UNSUPPORTED_FEATURE")
       assert(e1.getSqlState === "0A000")
-      assert(e1.getMessage.matches("""The feature is not supported: literal for '.+' of .+\."""))
+      assert(e1.getMessage.matches(
+      """The feature is not supported: a type '.+' is not supported as a literal type."""))

Review comment:
       The goal of SPARK-38097 is to improve error message in the pivot code. This error is fine, and could be the same.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala
##########
@@ -134,7 +135,6 @@ class QueryExecutionErrorsSuite extends QueryTest with SharedSparkSession {
         .collect()
     }
     assert(e2.getMessage === "The feature is not supported: " +
-      "literal for '[dotnet,Dummies]' of class " +
-      "org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema.")
+      "a type '[dotnet,Dummies]' is not supported as a literal type.")

Review comment:
       The message still can confuse users because there are no explicit literals in the code above. It would be nice if you catch the exception in the pivot code, and raise more clear exception with more precise error message.




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