andygrove commented on code in PR #1321:
URL: https://github.com/apache/datafusion-comet/pull/1321#discussion_r1931057042
##########
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala:
##########
@@ -2701,4 +2701,20 @@ class CometExpressionSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
}
}
}
+
+ test("array_compact") {
+ assume(isSpark34Plus)
+ Seq(true, false).foreach { dictionaryEnabled =>
+ withTempDir { dir =>
+ val path = new Path(dir.toURI.toString, "test.parquet")
+ makeParquetFileAllTypes(path, dictionaryEnabled = dictionaryEnabled, n
= 10000)
+ spark.read.parquet(path.toString).createOrReplaceTempView("t1")
+
+ checkSparkAnswerAndOperator(
+ sql("SELECT array_compact(array(_2)) FROM t1 WHERE _2 IS NULL"))
+ checkSparkAnswerAndOperator(
+ sql("SELECT array_compact(array(_2)) FROM t1 WHERE _2 IS NOT NULL"))
Review Comment:
I'd like to see tests covering the case where the array contains both null
and non null values, but we can address that as part of
https://github.com/apache/datafusion-comet/issues/1269.
--
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]