Skip to content

Commit 988e021

Browse files
committed
added comet expression test
1 parent d477f3b commit 988e021

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,18 +2522,10 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
25222522
withTempDir { dir =>
25232523
val path = new Path(dir.toURI.toString, "test.parquet")
25242524
makeParquetFileAllTypes(path, dictionaryEnabled, 10000)
2525-
2526-
// Test basic array_remove functionality
2527-
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(1, 2, 3, null, 3), 2)"))
2528-
2529-
// Test removing multiple occurrences
2530-
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(1, 3, 3, null, 3), 3)"))
2531-
2532-
// Test removing null
2533-
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(1, 2, null, 4, null), null)"))
2534-
2535-
// Test when element doesn't exist
2536-
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(1, 2, 3), 5)"))
2525+
spark.read.parquet(path.toString).createOrReplaceTempView("t1");
2526+
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(_2, _3,_4), 2) from t1"))
2527+
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(_2, _3,_4), 3) from t1"))
2528+
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(_2, _3,_4), 5) from t1"))
25372529
}
25382530
}
25392531
}

0 commit comments

Comments
 (0)