Skip to content

Commit

Permalink
rename to plural
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Zhang committed Dec 18, 2023
1 parent 577e242 commit e8335a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/apache/iceberg/CatalogUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public void dropTableDataDeletesExpectedFiles() throws IOException {
Set<String> manifestLocations = manifestLocations(snapshotSet, table.io());
Set<String> dataLocations = dataLocations(snapshotSet, table.io());
Set<String> metadataLocations = metadataLocations(tableMetadata);
Set<String> statisticLocations = statisticLocations(tableMetadata);
Set<String> 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()))
Expand All @@ -90,7 +90,7 @@ public void dropTableDataDeletesExpectedFiles() throws IOException {
+ manifestLocations.size()
+ dataLocations.size()
+ metadataLocations.size()
+ statisticLocations.size()))
+ statsLocations.size()))
.deleteFile(argumentCaptor.capture());

List<String> deletedPaths = argumentCaptor.getAllValues();
Expand All @@ -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
Expand Down Expand Up @@ -206,7 +206,7 @@ private Set<String> metadataLocations(TableMetadata tableMetadata) {
return metadataLocations;
}

private Set<String> statisticLocations(TableMetadata tableMetadata) {
private Set<String> statsLocations(TableMetadata tableMetadata) {
return tableMetadata.statisticsFiles().stream()
.map(StatisticsFile::path)
.collect(Collectors.toSet());
Expand Down

0 comments on commit e8335a0

Please sign in to comment.