rdblue commented on a change in pull request #600: Implement in and notIn in 
multiple visitors
URL: https://github.com/apache/incubator-iceberg/pull/600#discussion_r355149786
 
 

 ##########
 File path: 
api/src/test/java/org/apache/iceberg/expressions/TestInclusiveMetricsEvaluator.java
 ##########
 @@ -431,4 +433,52 @@ public void testStringStartsWith() {
     shouldRead = new InclusiveMetricsEvaluator(SCHEMA, startsWith("required", 
aboveMax), true).eval(FILE_4);
     Assert.assertFalse("Should not read: range doesn't match", shouldRead);
   }
+
+  @Test
+  public void testIntegerIn() {
+    boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, in("id", 5, 
6)).eval(FILE);
+    Assert.assertFalse("Should not read: id below lower bound", shouldRead);
+
+    shouldRead = new InclusiveMetricsEvaluator(SCHEMA, in("id", 28, 
29)).eval(FILE);
+    Assert.assertFalse("Should not read: id below lower bound", shouldRead);
+
+    shouldRead = new InclusiveMetricsEvaluator(SCHEMA, in("id", 30, 
31)).eval(FILE);
+    Assert.assertTrue("Should read: id equal to lower bound", shouldRead);
+
+    shouldRead = new InclusiveMetricsEvaluator(SCHEMA, in("id", 75, 
76)).eval(FILE);
+    Assert.assertTrue("Should read: id between lower and upper bounds", 
shouldRead);
+
+    shouldRead = new InclusiveMetricsEvaluator(SCHEMA, in("id", 79, 
80)).eval(FILE);
+    Assert.assertTrue("Should read: id equal to upper bound", shouldRead);
+
+    shouldRead = new InclusiveMetricsEvaluator(SCHEMA, in("id", 80, 
81)).eval(FILE);
+    Assert.assertFalse("Should not read: id above upper bound", shouldRead);
+
+    shouldRead = new InclusiveMetricsEvaluator(SCHEMA, in("id", 85, 
86)).eval(FILE);
+    Assert.assertFalse("Should not read: id above upper bound", shouldRead);
+  }
+
+  @Test
+  public void testIntegerNotIn() {
+    boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, notIn("id", 5, 
6)).eval(FILE);
+    Assert.assertTrue("Should read: id below lower bound", shouldRead);
+
+    shouldRead = new InclusiveMetricsEvaluator(SCHEMA, notIn("id", 28, 
29)).eval(FILE);
+    Assert.assertTrue("Should read: id below lower bound", shouldRead);
+
+    shouldRead = new InclusiveMetricsEvaluator(SCHEMA, notIn("id", 30, 
31)).eval(FILE);
 
 Review comment:
   I agree with @moulimukherjee, it would be nice for the test cases to be in 
terms of file's min and max.

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


With regards,
Apache Git Services

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

Reply via email to