xloya commented on a change in pull request #3135:
URL: https://github.com/apache/iceberg/pull/3135#discussion_r714427583
##########
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);
Review comment:
@rdblue Previously, the data file was written using `Row.of(0)`, which
means that all data is written to the `1970-01-01` partition. So all the equal
delete data before is also written to `Row.of(0)`. Now it is changed that the
data is written to the corresponding date time partition, and then the equality
delete data is also written to the corresponding partition.
If keep the data file written to the partition as `1970-01-01`, but the
partition where the equality delete data is actually written is changed to
`2021-09-01`, it will not work.
Found spec on official website:
[http://iceberg.apache.org/spec/](url)
`Like data files, delete files are tracked by partition. In general, a
delete file must be applied to older data files with the same partition; see
Scan Planning for details. Column metrics can be used to determine whether a
delete file’s rows overlap the contents of a data file or a scan range.`
--
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]