Github user maropu commented on a diff in the pull request:
https://github.com/apache/spark/pull/21830#discussion_r204208955
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala ---
@@ -918,34 +918,55 @@ class DataFrameFunctionsSuite extends QueryTest with
SharedSQLContext {
oneRowDF.cache()
testString()
- // Array test cases (primitive-type elements)
- val idf = Seq(
+ // Array test cases (primitive-type elements, containsNull = false)
+ val idfNotContainsNull = Seq(
Seq(1, 9, 8, 7),
Seq(5, 8, 9, 7, 2),
Seq.empty,
null
).toDF("i")
- def testArray(): Unit = {
+ def testArrayOfPrimitiveTypeNotContainsNull(): Unit = {
checkAnswer(
- idf.select(reverse('i)),
+ idfNotContainsNull.select(reverse('i)),
Seq(Row(Seq(7, 8, 9, 1)), Row(Seq(2, 7, 9, 8, 5)), Row(Seq.empty),
Row(null))
)
checkAnswer(
- idf.selectExpr("reverse(i)"),
+ idfNotContainsNull.selectExpr("reverse(i)"),
Seq(Row(Seq(7, 8, 9, 1)), Row(Seq(2, 7, 9, 8, 5)), Row(Seq.empty),
Row(null))
)
+ }
+
+ // Test with local relation, the Project will be evaluated without
codegen
--- End diff --
There are many tests here, so I think it'd be nice to split the tests into
two or three parts.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]