From 67eb8723d4826a982d65fc86617188f30f02085b Mon Sep 17 00:00:00 2001 From: Xianjin Date: Tue, 16 Jan 2024 19:10:34 +0800 Subject: [PATCH] address comments --- .../iceberg/actions/RewriteDataFilesCommitManager.java | 8 ++++---- .../actions/RewritePositionDeletesCommitManager.java | 8 ++++---- .../iceberg/spark/actions/TestRewriteDataFilesAction.java | 2 +- .../actions/TestRewritePositionDeleteFilesAction.java | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/org/apache/iceberg/actions/RewriteDataFilesCommitManager.java b/core/src/main/java/org/apache/iceberg/actions/RewriteDataFilesCommitManager.java index 997116d0b517..7f89db467d73 100644 --- a/core/src/main/java/org/apache/iceberg/actions/RewriteDataFilesCommitManager.java +++ b/core/src/main/java/org/apache/iceberg/actions/RewriteDataFilesCommitManager.java @@ -38,7 +38,7 @@ public class RewriteDataFilesCommitManager { private final Table table; private final long startingSnapshotId; private final boolean useStartingSequenceNumber; - private final Map extraCommitSummary; + private final Map snapshotProperties; // constructor used for testing public RewriteDataFilesCommitManager(Table table) { @@ -58,11 +58,11 @@ public RewriteDataFilesCommitManager( Table table, long startingSnapshotId, boolean useStartingSequenceNumber, - Map extraCommitSummary) { + Map snapshotProperties) { this.table = table; this.startingSnapshotId = startingSnapshotId; this.useStartingSequenceNumber = useStartingSequenceNumber; - this.extraCommitSummary = extraCommitSummary; + this.snapshotProperties = snapshotProperties; } /** @@ -87,7 +87,7 @@ public void commitFileGroups(Set fileGroups) { rewrite.rewriteFiles(rewrittenDataFiles, addedDataFiles); } - extraCommitSummary.forEach(rewrite::set); + snapshotProperties.forEach(rewrite::set); rewrite.commit(); } diff --git a/core/src/main/java/org/apache/iceberg/actions/RewritePositionDeletesCommitManager.java b/core/src/main/java/org/apache/iceberg/actions/RewritePositionDeletesCommitManager.java index 504192515b6d..01b2f7528ee3 100644 --- a/core/src/main/java/org/apache/iceberg/actions/RewritePositionDeletesCommitManager.java +++ b/core/src/main/java/org/apache/iceberg/actions/RewritePositionDeletesCommitManager.java @@ -41,16 +41,16 @@ public class RewritePositionDeletesCommitManager { private final Table table; private final long startingSnapshotId; - private final Map extraCommitSummary; + private final Map snapshotProperties; public RewritePositionDeletesCommitManager(Table table) { this(table, ImmutableMap.of()); } - public RewritePositionDeletesCommitManager(Table table, Map extraCommitSummary) { + public RewritePositionDeletesCommitManager(Table table, Map snapshotProperties) { this.table = table; this.startingSnapshotId = table.currentSnapshot().snapshotId(); - this.extraCommitSummary = extraCommitSummary; + this.snapshotProperties = snapshotProperties; } /** @@ -72,7 +72,7 @@ public void commit(Set fileGroups) { } } - extraCommitSummary.forEach(rewriteFiles::set); + snapshotProperties.forEach(rewriteFiles::set); rewriteFiles.commit(); } diff --git a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewriteDataFilesAction.java b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewriteDataFilesAction.java index 9df127b20bae..82b32f2ce002 100644 --- a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewriteDataFilesAction.java +++ b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewriteDataFilesAction.java @@ -1452,7 +1452,7 @@ public void testSnapshotProperty() { Result ignored = basicRewrite(table).snapshotProperty("key", "value").execute(); assertThat(table.currentSnapshot().summary()) .containsAllEntriesOf(ImmutableMap.of("key", "value")); - // make sure internal produced properties is not lost + // make sure internal produced properties are not lost String[] commitMetricsKeys = new String[] { SnapshotSummary.ADDED_FILES_PROP, diff --git a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java index caa7d065020f..89c44dbfccf8 100644 --- a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java +++ b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java @@ -633,7 +633,7 @@ public void testSnapshotProperty() throws Exception { assertThat(table.currentSnapshot().summary()) .containsAllEntriesOf(ImmutableMap.of("key", "value")); - // make sure internal produced properties is not lost + // make sure internal produced properties are not lost String[] commitMetricsKeys = new String[] { SnapshotSummary.ADDED_DELETE_FILES_PROP,