kazuyukitanimura commented on code in PR #1321: URL: https://github.com/apache/datafusion-comet/pull/1321#discussion_r1931235025
########## spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala: ########## @@ -2428,6 +2428,22 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde with CometExprShim withInfo(expr, "unsupported arguments for ArrayJoin", exprs: _*) None } + case expr @ ArrayFilter(child, _) if ArrayCompact(child).replacement.sql == expr.sql => Review Comment: Would you add a flag to enable and disable? ########## 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: +1 for more coverage -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org