Skip to content

Commit e1d83fb

Browse files
committed
feat: support literal for ARRAY top level
1 parent bc58810 commit e1d83fb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

spark/src/test/scala/org/apache/comet/CometArrayExpressionSuite.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,15 @@ class CometArrayExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelp
222222
withSQLConf(
223223
CometConf.COMET_EXPR_ALLOW_INCOMPATIBLE.key -> "true",
224224
CometConf.COMET_EXPLAIN_FALLBACK_ENABLED.key -> "true"
225-
// "spark.sql.optimizer.excludedRules" -> "org.apache.spark.sql.catalyst.optimizer.ConstantFolding"
226225
) {
227226
withTempDir { dir =>
228227
val path = new Path(dir.toURI.toString, "test.parquet")
229228
makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled = false, n = 10000)
230229
spark.read.parquet(path.toString).createOrReplaceTempView("t1");
231-
// checkSparkAnswerAndOperator(
232-
// spark.sql("SELECT array_contains(array(_2, _3, _4), _2) FROM t1"))
233-
// checkSparkAnswerAndOperator(
234-
// spark.sql("SELECT array_contains((CASE WHEN _2 =_3 THEN array(_4) END), _4) FROM t1"));
235230
checkSparkAnswerAndOperator(
236-
spark.sql(
237-
"SELECT array_contains((CASE WHEN _2 =_3 THEN array(1, 2, 3) END), _4) FROM t1"));
231+
spark.sql("SELECT array_contains(array(_2, _3, _4), _2) FROM t1"))
232+
checkSparkAnswerAndOperator(
233+
spark.sql("SELECT array_contains((CASE WHEN _2 =_3 THEN array(_4) END), _4) FROM t1"));
238234
}
239235
}
240236
}

0 commit comments

Comments
 (0)