This is an automated email from the ASF dual-hosted git repository.
agrove pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git
The following commit(s) were added to refs/heads/main by this push:
new 7c78fef50 test: Add additional contains expression tests (#3462)
7c78fef50 is described below
commit 7c78fef50d37d9e4ffa1aed1d32e442b8e18f83b
Author: Andy Grove <[email protected]>
AuthorDate: Tue Feb 10 12:41:51 2026 -0700
test: Add additional contains expression tests (#3462)
---
.../scala/org/apache/comet/CometExpressionSuite.scala | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
b/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
index 206ac1726..112630045 100644
--- a/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
+++ b/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
@@ -1252,6 +1252,21 @@ class CometExpressionSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
// Test with pattern at end
val queryEnd = sql(s"select id from $table where contains (name,
'Smith')")
checkSparkAnswerAndOperator(queryEnd)
+
+ // Test with null haystack
+ sql(s"insert into $table values(6, null)")
+ checkSparkAnswerAndOperator(sql(s"select id, contains(name, 'Rose') from
$table"))
+
+ // Test case sensitivity (should not match)
+ checkSparkAnswerAndOperator(sql(s"select id from $table where
contains(name, 'james')"))
+ }
+ }
+
+ test("contains with both columns") {
+ withParquetTable(
+ Seq(("hello world", "world"), ("foo bar", "baz"), ("abc", ""), (null,
"x"), ("test", null)),
+ "tbl") {
+ checkSparkAnswerAndOperator(sql("select contains(_1, _2) from tbl"))
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]