coderfender commented on code in PR #1944: URL: https://github.com/apache/datafusion-comet/pull/1944#discussion_r2258579719
########## spark/src/test/scala/org/apache/comet/CometArrayExpressionSuite.scala: ########## @@ -406,6 +406,29 @@ class CometArrayExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelp } } + test("array_min") { + Seq(true, false).foreach { dictionaryEnabled => + withTempDir { dir => + val path = new Path(dir.toURI.toString, "test.parquet") + makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled, n = 10000) + spark.read.parquet(path.toString).createOrReplaceTempView("t1"); + checkSparkAnswerAndOperator(spark.sql("SELECT array_min(array(_2, _3, _4)) FROM t1")) + checkSparkAnswerAndOperator( + spark.sql("SELECT array_min((CASE WHEN _2 =_3 THEN array(_4) END)) FROM t1")) + checkSparkAnswerAndOperator( + spark.sql("SELECT array_min((CASE WHEN _2 =_3 THEN array(_2, _4) END)) FROM t1")) + checkSparkAnswerAndOperator( + spark.sql("SELECT array_min(array(CAST(NULL AS INT), CAST(NULL AS INT))) FROM t1")) + checkSparkAnswerAndOperator( + spark.sql("SELECT array_min(array(_2, CAST(NULL AS INT))) FROM t1")) + checkSparkAnswerAndOperator(spark.sql("SELECT array_min(array()) FROM t1")) + checkSparkAnswerAndOperator( + spark.sql( + "SELECT array_min(array(double('-Infinity'), 0.0, double('Infinity'))) FROM t1")) + } + } + } + Review Comment: Minor nitpick : Could improve our test coverage by adding tests on rust side as well ? Apart from that the changes look good to me -- 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