xloya commented on a change in pull request #3135:
URL: https://github.com/apache/iceberg/pull/3135#discussion_r714439493



##########
File path: data/src/test/java/org/apache/iceberg/data/DeleteReadTests.java
##########
@@ -125,6 +166,42 @@ public void testEqualityDeletes() throws IOException {
     Assert.assertEquals("Table should contain expected rows", expected, 
actual);
   }
 
+  @Test
+  public void testEqualityDateDeletes() throws IOException {
+    initTable2();
+
+    Schema deleteRowSchema = table2.schema().select("*");
+    Record dataDelete = GenericRecord.create(deleteRowSchema);
+    List<Record> dataDeletes = Lists.newArrayList(
+            dataDelete.copy("dt", LocalDate.parse("2021-09-01"), "data", "a", 
"id", 1),
+            dataDelete.copy("dt", LocalDate.parse("2021-09-02"), "data", "b", 
"id", 2),
+            dataDelete.copy("dt", LocalDate.parse("2021-09-03"), "data", "c", 
"id", 3)
+    );
+
+    DeleteFile eqDeletes = FileHelpers.writeDeleteFile(
+            table2, Files.localOutput(temp.newFile()), Row.of(0), dataDeletes, 
deleteRowSchema);
+
+    table2.newRowDelta()
+            .addDeletes(eqDeletes)
+            .commit();
+
+    StructLikeSet expected = rowSetWithoutIds2(1, 2, 3);
+    StructLikeSet expectedSet = 
StructLikeSet.create(table2.schema().asStruct());
+
+    Iterables.addAll(expectedSet, expected.stream()
+            .map(record -> new 
InternalRecordWrapper(table2.schema().asStruct()).wrap(record))
+            .collect(Collectors.toList()));
+
+    StructLikeSet actual = rowSet(tableName2, table2, "*");
+    StructLikeSet actualSet = StructLikeSet.create(table2.schema().asStruct());
+
+    Iterables.addAll(actualSet, actual.stream()
+            .map(record -> new 
InternalRecordWrapper(table2.schema().asStruct()).wrap(record))
+            .collect(Collectors.toList()));

Review comment:
       Maybe i should encapsulate the assertion method? Or overwrite 
rowSetWithoutIds() method for different wrapper?




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