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 2021/01/11 15:55:32 UTC
[GitHub] [spark] MrPowers commented on a change in pull request #31132: [SPARK-34072][SQL] Fix empty array failed in functions.lit()
MrPowers commented on a change in pull request #31132:
URL: https://github.com/apache/spark/pull/31132#discussion_r555149666
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
##########
@@ -1982,6 +1982,13 @@ class DatasetSuite extends QueryTest
assert(timezone == "Asia/Shanghai")
}
}
+
+ test("SPARK-34072: Fix empty array failed in functions.lit()") {
+ checkAnswer(
+ spark.range(1).select(lit(Array())),
Review comment:
@ulysses-you - does `spark.range(1).select(typedLit(Array()))` get you the result you're looking for? Per the docs, "The difference between the typedLit function and lit is that this function can handle parameterized scala types e.g.: List, Seq and Map." `lit` isn't normally used for collections.
----------------------------------------------------------------
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.
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