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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]