From e8335a0cbef65045daa87cc60731ab930d3ee922 Mon Sep 17 00:00:00 2001 From: Steve Zhang Date: Mon, 18 Dec 2023 12:30:18 -0800 Subject: [PATCH] rename to plural --- core/src/main/java/org/apache/iceberg/CatalogUtil.java | 2 +- .../iceberg/hadoop/TestCatalogUtilDropTable.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/apache/iceberg/CatalogUtil.java b/core/src/main/java/org/apache/iceberg/CatalogUtil.java index cc55e4f51292..2d16b19fc90d 100644 --- a/core/src/main/java/org/apache/iceberg/CatalogUtil.java +++ b/core/src/main/java/org/apache/iceberg/CatalogUtil.java @@ -120,7 +120,7 @@ public static void dropTableData(FileIO io, TableMetadata metadata) { deleteFiles( io, Iterables.transform(metadata.statisticsFiles(), StatisticsFile::path), - "statistic", + "statistics", true); deleteFile(io, metadata.metadataFileLocation(), "metadata"); } diff --git a/core/src/test/java/org/apache/iceberg/hadoop/TestCatalogUtilDropTable.java b/core/src/test/java/org/apache/iceberg/hadoop/TestCatalogUtilDropTable.java index 4bff9ac8dbd9..b8511bef5281 100644 --- a/core/src/test/java/org/apache/iceberg/hadoop/TestCatalogUtilDropTable.java +++ b/core/src/test/java/org/apache/iceberg/hadoop/TestCatalogUtilDropTable.java @@ -67,10 +67,10 @@ public void dropTableDataDeletesExpectedFiles() throws IOException { Set manifestLocations = manifestLocations(snapshotSet, table.io()); Set dataLocations = dataLocations(snapshotSet, table.io()); Set metadataLocations = metadataLocations(tableMetadata); - Set statisticLocations = statisticLocations(tableMetadata); + Set statsLocations = statsLocations(tableMetadata); Assertions.assertThat(manifestListLocations).as("should have 2 manifest lists").hasSize(2); Assertions.assertThat(metadataLocations).as("should have 4 metadata locations").hasSize(4); - Assertions.assertThat(statisticLocations).as("should have 1 statistic file").hasSize(1); + Assertions.assertThat(statsLocations).as("should have 1 stats file").hasSize(1); FileIO fileIO = Mockito.mock(FileIO.class); Mockito.when(fileIO.newInputFile(Mockito.anyString())) @@ -90,7 +90,7 @@ public void dropTableDataDeletesExpectedFiles() throws IOException { + manifestLocations.size() + dataLocations.size() + metadataLocations.size() - + statisticLocations.size())) + + statsLocations.size())) .deleteFile(argumentCaptor.capture()); List deletedPaths = argumentCaptor.getAllValues(); @@ -108,7 +108,7 @@ public void dropTableDataDeletesExpectedFiles() throws IOException { .containsAll(metadataLocations); Assertions.assertThat(deletedPaths) .as("should contain all created statistic") - .containsAll(statisticLocations); + .containsAll(statsLocations); } @Test @@ -206,7 +206,7 @@ private Set metadataLocations(TableMetadata tableMetadata) { return metadataLocations; } - private Set statisticLocations(TableMetadata tableMetadata) { + private Set statsLocations(TableMetadata tableMetadata) { return tableMetadata.statisticsFiles().stream() .map(StatisticsFile::path) .collect(Collectors.toSet());