gaborkaszab commented on code in PR #16125:
URL: https://github.com/apache/iceberg/pull/16125#discussion_r3636422879
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/source/TestIcebergSourceTablesBase.java:
##########
@@ -1758,6 +1769,44 @@ public void testPartitionsTableDeleteStats() {
}
}
+ @Test
+ public void testPartitionsTableDvCount() {
+ TableIdentifier tableIdentifier = TableIdentifier.of("db",
"partitions_dv_test");
+ Table table =
+ createTable(
+ tableIdentifier, SCHEMA, SPEC,
ImmutableMap.of(TableProperties.FORMAT_VERSION, "3"));
+ Dataset<Row> df1 =
+ spark.createDataFrame(Lists.newArrayList(new SimpleRecord(1, "a")),
SimpleRecord.class);
+ df1.select("id", "data")
+ .write()
+ .format("iceberg")
+ .mode("append")
+ .save(loadLocation(tableIdentifier));
+ Dataset<Row> df2 =
+ spark.createDataFrame(Lists.newArrayList(new SimpleRecord(1, "b")),
SimpleRecord.class);
+ df2.select("id", "data")
+ .write()
+ .format("iceberg")
+ .mode("append")
+ .save(loadLocation(tableIdentifier));
+ table.refresh();
+ List<DataFile> dataFiles = TestHelpers.dataFiles(table);
+ DeleteFile dvFile1 = FileGenerationUtil.generateDV(table,
dataFiles.get(0));
+ DeleteFile dvFile2 = FileGenerationUtil.generateDV(table,
dataFiles.get(1));
+ table.newRowDelta().addDeletes(dvFile1).addDeletes(dvFile2).commit();
+ table.refresh();
+ List<Row> actual =
Review Comment:
nit: a line break after each logical group would make this test more
readable. One after setting up the test, one after performing the test before
the asserts.
--
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]