ajantha-bhat commented on code in PR #9305:
URL: https://github.com/apache/iceberg/pull/9305#discussion_r1427885903
##########
core/src/test/java/org/apache/iceberg/hadoop/TestCatalogUtilDropTable.java:
##########
@@ -38,19 +49,28 @@
public class TestCatalogUtilDropTable extends HadoopTableTestBase {
@Test
- public void dropTableDataDeletesExpectedFiles() {
+ public void dropTableDataDeletesExpectedFiles() throws IOException {
table.newFastAppend().appendFile(FILE_A).commit();
table.newAppend().appendFile(FILE_B).commit();
+ StatisticsFile statisticsFile =
+ writeStatsFile(
+ table.currentSnapshot().snapshotId(),
+ table.currentSnapshot().sequenceNumber(),
+ tableLocation + "/metadata/" + UUID.randomUUID() + ".stats",
+ table.io());
+ table.updateStatistics().setStatistics(statisticsFile.snapshotId(),
statisticsFile).commit();
- TableMetadata tableMetadata = readMetadataVersion(3);
+ TableMetadata tableMetadata = readMetadataVersion(4);
Set<Snapshot> snapshotSet = Sets.newHashSet(table.snapshots());
Set<String> manifestListLocations = manifestListLocations(snapshotSet);
Set<String> manifestLocations = manifestLocations(snapshotSet, table.io());
Set<String> dataLocations = dataLocations(snapshotSet, table.io());
Set<String> metadataLocations = metadataLocations(tableMetadata);
+ Set<String> statisticLocations = statisticLocations(tableMetadata);
Review Comment:
this variable name and method name can be statisticsLocations ('s' is
missing) to be inline with naming of other places or just statsLocations is
also fine.
##########
core/src/main/java/org/apache/iceberg/CatalogUtil.java:
##########
@@ -117,6 +117,11 @@ public static void dropTableData(FileIO io, TableMetadata
metadata) {
Iterables.transform(metadata.previousFiles(),
TableMetadata.MetadataLogEntry::file),
"previous metadata",
true);
+ deleteFiles(
+ io,
+ Iterables.transform(metadata.statisticsFiles(), StatisticsFile::path),
+ "statistic",
Review Comment:
```suggestion
"statistics",
```
--
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]