hantangwangd commented on code in PR #16697:
URL: https://github.com/apache/iceberg/pull/16697#discussion_r3369197937


##########
data/src/test/java/org/apache/iceberg/data/TestLocalScan.java:
##########
@@ -275,6 +275,48 @@ public void testRandomData() throws IOException {
     assertThat(records).as("Random record set should 
match").isEqualTo(expected);
   }
 
+  @TestTemplate
+  public void testFilterByInPredicate() throws IOException {
+    File location = new File(tempDir, "junit" + System.nanoTime());
+
+    Table table =
+        TABLES.create(
+            SCHEMA,
+            PartitionSpec.unpartitioned(),
+            ImmutableMap.of(TableProperties.DEFAULT_FILE_FORMAT, 
format.name()),
+            location.toString());
+
+    AppendFiles append = table.newAppend();
+    Path path = new Path(location.toString(), format.addExtension("file-1"));
+    List<Record> records = Lists.newArrayList();
+    records.add(genericRecord.copy(ImmutableMap.of("id", 1L, "data", "v1")));
+    records.add(genericRecord.copy(ImmutableMap.of("id", 2L, "data", "v3")));
+    Record record = genericRecord.copy();
+    record.setField("id", 3L);
+    record.setField("data", null);
+    records.add(record);
+
+    writeFile(location.toString(), format.addExtension("file-1"), records);
+    DataFile file =
+        DataFiles.builder(PartitionSpec.unpartitioned())
+            .withRecordCount(records.size())
+            .withInputFile(HadoopInputFile.fromPath(path, CONF))
+            .build();
+    append.appendFile(file);
+    append.commit();
+
+    List<Record> filterResults =
+        Lists.newArrayList(
+            IcebergGenerics.read(table).where(Expressions.in("data", "v3", 
"v5")).build());
+
+    List<Record> expected =
+        ImmutableList.of(genericRecord.copy(ImmutableMap.of("id", 2L, "data", 
"v3")));
+    assertThat(filterResults)
+        .as("Should produce correct number of records")
+        .hasSameSizeAs(expected);
+    assertThat(filterResults).as("Random record set should 
match").isEqualTo(expected);

Review Comment:
   @ebyhr nice catch! Thanks for the review. I've fixed it. PTAL when you get a 
chance.



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

To unsubscribe, e-mail: [email protected]

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