LuciferYang commented on code in PR #44607:
URL: https://github.com/apache/spark/pull/44607#discussion_r1442539695
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralExpressionSuite.scala:
##########
@@ -477,4 +477,12 @@ class LiteralExpressionSuite extends SparkFunSuite with
ExpressionEvalHelper {
Literal.create(UTF8String.fromString("Spark SQL"),
ObjectType(classOf[UTF8String])),
UTF8String.fromString("Spark SQL"))
}
+
+ test("SPARK-46604: Literal support immutable ArraySeq") {
+ val immArraySeq = immutable.ArraySeq.unsafeWrapArray(Array(1.0, 4.0))
+ val expected = toCatalyst(immArraySeq)
+ checkEvaluation(Literal(immArraySeq), expected)
+ checkEvaluation(Literal.create(immArraySeq), expected)
+ checkEvaluation(Literal.create(immArraySeq, ArrayType(DoubleType)),
expected)
Review Comment:
Even without this PR, the following two lines can pass the test
successfully. These two lines are just to increase test coverage.
```
checkEvaluation(Literal.create(immArraySeq), expected)
checkEvaluation(Literal.create(immArraySeq, ArrayType(DoubleType)), expected)
```
--
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]