kbendick commented on a change in pull request #2062:
URL: https://github.com/apache/iceberg/pull/2062#discussion_r567383832



##########
File path: 
api/src/test/java/org/apache/iceberg/expressions/TestInclusiveManifestEvaluator.java
##########
@@ -389,6 +396,39 @@ public void testStringStartsWith() {
     Assert.assertFalse("Should skip: range doesn't match", shouldRead);
   }
 
+  @Test
+  public void testStringNotStartsWith() {
+    boolean shouldRead = 
ManifestEvaluator.forRowFilter(notStartsWith("some_nulls", "a"), SPEC, 
false).eval(FILE);
+    Assert.assertTrue("Should read: range matches", shouldRead);
+
+    shouldRead = ManifestEvaluator.forRowFilter(notStartsWith("some_nulls", 
"aa"), SPEC, false).eval(FILE);
+    Assert.assertTrue("Should read: range matches", shouldRead);
+
+    shouldRead = ManifestEvaluator.forRowFilter(notStartsWith("some_nulls", 
"dddd"), SPEC, false).eval(FILE);
+    Assert.assertTrue("Should read: range matches", shouldRead);
+
+    shouldRead = ManifestEvaluator.forRowFilter(notStartsWith("some_nulls", 
"z"), SPEC, false).eval(FILE);
+    Assert.assertTrue("Should read: range matches", shouldRead);
+
+    shouldRead = ManifestEvaluator.forRowFilter(notStartsWith("no_nulls", 
"a"), SPEC, false).eval(FILE);
+    Assert.assertTrue("Should read: range matches", shouldRead);
+
+    shouldRead = ManifestEvaluator.forRowFilter(notStartsWith("some_nulls", 
"zzzz"), SPEC, false).eval(FILE);
+    Assert.assertTrue("Should read: range matches", shouldRead);
+
+    shouldRead = ManifestEvaluator.forRowFilter(notStartsWith("some_nulls", 
"1"), SPEC, false).eval(FILE);
+    Assert.assertTrue("Should read: range matches", shouldRead);

Review comment:
       Will do.
   
   I had thought about the matching on `notStartsWith` for null boundaries, but 
I think I originally did not check properly (I was using a filter function I 
think). I just went through and checked with SQL, and the nulls matched on the 
equivalent for `notStartsWith`.
   
   ```
   scala> val df = Seq("hi", null, "there", "world").toDF("word")
   df: org.apache.spark.sql.DataFrame = [word: string]
   df.selectExpr("word not like 'wo%'").show(false)
   +-------------------+
   |(NOT word LIKE wo%)|
   +-------------------+
   |true               |
   |null               |
   |true               |
   |false              |
   +-------------------+
   ```
   
   
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to