You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/04/04 07:56:00 UTC
[GitHub] [spark] MaxGekk commented on a diff in pull request #40634: [SPARK-42840][SQL] Rename the error class _LEGACY_ERROR_TEMP_2004 to NO_DEFAULT_FOR_DATA_TYPE
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: 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