kazuyukitanimura commented on code in PR #3901:
URL: https://github.com/apache/datafusion-comet/pull/3901#discussion_r3033978038
##########
spark/src/test/scala/org/apache/comet/CometArrayExpressionSuite.scala:
##########
@@ -545,27 +545,59 @@ class CometArrayExpressionSuite extends CometTestBase
with AdaptiveSparkPlanHelp
}
test("arrays_overlap") {
-
withSQLConf(CometConf.getExprAllowIncompatConfigKey(classOf[ArraysOverlap]) ->
"true") {
- Seq(true, false).foreach { dictionaryEnabled =>
- withTempDir { dir =>
- withTempView("t1") {
- val path = new Path(dir.toURI.toString, "test.parquet")
- makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled, 10000)
- spark.read.parquet(path.toString).createOrReplaceTempView("t1")
- checkSparkAnswerAndOperator(sql(
- "SELECT arrays_overlap(array(_2, _3, _4), array(_3, _4)) from t1
where _2 is not null"))
- checkSparkAnswerAndOperator(sql(
- "SELECT arrays_overlap(array('a', null, cast(_1 as string)),
array('b', cast(_1 as string), cast(_2 as string))) from t1 where _1 is not
null"))
- checkSparkAnswerAndOperator(sql(
- "SELECT arrays_overlap(array('a', null), array('b', null)) from
t1 where _1 is not null"))
- checkSparkAnswerAndOperator(spark.sql(
- "SELECT arrays_overlap((CASE WHEN _2 =_3 THEN array(_6, _7)
END), array(_6, _7)) FROM t1"));
- }
+ Seq(true, false).foreach { dictionaryEnabled =>
+ withTempDir { dir =>
+ withTempView("t1") {
+ val path = new Path(dir.toURI.toString, "test.parquet")
+ makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled, 10000)
+ spark.read.parquet(path.toString).createOrReplaceTempView("t1")
+ checkSparkAnswerAndOperator(sql(
+ "SELECT arrays_overlap(array(_2, _3, _4), array(_3, _4)) from t1
where _2 is not null"))
+ checkSparkAnswerAndOperator(sql(
+ "SELECT arrays_overlap(array('a', null, cast(_1 as string)),
array('b', cast(_1 as string), cast(_2 as string))) from t1 where _1 is not
null"))
+ checkSparkAnswerAndOperator(sql(
+ "SELECT arrays_overlap(array('a', null), array('b', null)) from t1
where _1 is not null"))
+ checkSparkAnswerAndOperator(spark.sql(
+ "SELECT arrays_overlap((CASE WHEN _2 =_3 THEN array(_6, _7) END),
array(_6, _7)) FROM t1"));
}
}
}
}
+ test("arrays_overlap - null handling behavior verification") {
Review Comment:
Copied from https://github.com/apache/datafusion-comet/pull/3364
--
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]