MaxGekk commented on code in PR #40634:
URL: https://github.com/apache/spark/pull/40634#discussion_r1156867338
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralExpressionSuite.scala:
##########
@@ -88,6 +88,17 @@ class LiteralExpressionSuite extends SparkFunSuite with
ExpressionEvalHelper {
checkEvaluation(Literal.default(StructType(StructField("a", StringType) ::
Nil)), Row(""))
// ExamplePointUDT.sqlType is ArrayType(DoubleType, false).
checkEvaluation(Literal.default(new ExamplePointUDT), Array())
+
+ // DateType without default value`
+ List(CharType(1), VarcharType(1)).foreach(errType => {
+ checkError(
+ exception = intercept[SparkRuntimeException] {
+ Literal.default(errType)
Review Comment:
Can you trigger the error from user code, for instance, some SQL query? If
not, we should convert this error to an internal error
`SparkException.internalError()`.
--
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]