You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2021/10/21 23:30:19 UTC
[iceberg] branch master updated: API: Remove deprecated APIs up to
0.12.0 (#3331)
This is an automated email from the ASF dual-hosted git repository.
blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new 4ea8663 API: Remove deprecated APIs up to 0.12.0 (#3331)
4ea8663 is described below
commit 4ea86630438d17dbc24d0d15fe0e685c37b71711
Author: Yufei Gu <yu...@apache.org>
AuthorDate: Thu Oct 21 16:30:08 2021 -0700
API: Remove deprecated APIs up to 0.12.0 (#3331)
---
api/src/main/java/org/apache/iceberg/Metrics.java | 32 ----------
.../java/org/apache/iceberg/OverwriteFiles.java | 21 -------
.../iceberg/transforms/PartitionSpecVisitor.java | 17 +-----
.../apache/iceberg/TestMetricsSerialization.java | 4 +-
.../org/apache/iceberg/BaseOverwriteFiles.java | 10 ---
.../org/apache/iceberg/TableMetadataParser.java | 8 ---
.../java/org/apache/iceberg/avro/AvroMetrics.java | 2 +-
.../java/org/apache/iceberg/TestFilterFiles.java | 4 +-
.../java/org/apache/iceberg/TestFindFiles.java | 1 +
.../java/org/apache/iceberg/TestOverwrite.java | 3 +
.../iceberg/TestOverwriteWithValidation.java | 71 ++++++++++++++++------
.../apache/iceberg/TestScanDataFileColumns.java | 3 +
.../org/apache/iceberg/TestSnapshotSelection.java | 1 +
.../apache/iceberg/data/TableMigrationUtil.java | 2 +-
14 files changed, 68 insertions(+), 111 deletions(-)
diff --git a/api/src/main/java/org/apache/iceberg/Metrics.java b/api/src/main/java/org/apache/iceberg/Metrics.java
index 8a213ad..30a9a8c 100644
--- a/api/src/main/java/org/apache/iceberg/Metrics.java
+++ b/api/src/main/java/org/apache/iceberg/Metrics.java
@@ -44,20 +44,6 @@ public class Metrics implements Serializable {
public Metrics() {
}
- /**
- * @deprecated will be removed in 0.12.0; use {@link #Metrics(Long, Map, Map, Map, Map)} instead.
- */
- @Deprecated
- public Metrics(Long rowCount,
- Map<Integer, Long> columnSizes,
- Map<Integer, Long> valueCounts,
- Map<Integer, Long> nullValueCounts) {
- this.rowCount = rowCount;
- this.columnSizes = columnSizes;
- this.valueCounts = valueCounts;
- this.nullValueCounts = nullValueCounts;
- }
-
public Metrics(Long rowCount,
Map<Integer, Long> columnSizes,
Map<Integer, Long> valueCounts,
@@ -70,24 +56,6 @@ public class Metrics implements Serializable {
this.nanValueCounts = nanValueCounts;
}
- /**
- * @deprecated will be removed in 0.12.0; use {@link #Metrics(Long, Map, Map, Map, Map, Map, Map)} instead.
- */
- @Deprecated
- public Metrics(Long rowCount,
- Map<Integer, Long> columnSizes,
- Map<Integer, Long> valueCounts,
- Map<Integer, Long> nullValueCounts,
- Map<Integer, ByteBuffer> lowerBounds,
- Map<Integer, ByteBuffer> upperBounds) {
- this.rowCount = rowCount;
- this.columnSizes = columnSizes;
- this.valueCounts = valueCounts;
- this.nullValueCounts = nullValueCounts;
- this.lowerBounds = lowerBounds;
- this.upperBounds = upperBounds;
- }
-
public Metrics(Long rowCount,
Map<Integer, Long> columnSizes,
Map<Integer, Long> valueCounts,
diff --git a/api/src/main/java/org/apache/iceberg/OverwriteFiles.java b/api/src/main/java/org/apache/iceberg/OverwriteFiles.java
index e85545a..e86c99d5 100644
--- a/api/src/main/java/org/apache/iceberg/OverwriteFiles.java
+++ b/api/src/main/java/org/apache/iceberg/OverwriteFiles.java
@@ -131,27 +131,6 @@ public interface OverwriteFiles extends SnapshotUpdate<OverwriteFiles> {
}
/**
- * Enables validation that files added concurrently do not conflict with this commit's operation.
- * <p>
- * This method should be called when the table is queried to determine which files to delete/append.
- * If a concurrent operation commits a new file after the data was read and that file might
- * contain rows matching the specified conflict detection filter, the overwrite operation
- * will detect this during retries and fail.
- * <p>
- * Calling this method with a correct conflict detection filter is required to maintain
- * serializable isolation for eager update/delete operations. Otherwise, the isolation level
- * will be snapshot isolation.
- *
- * @param readSnapshotId the snapshot id that was used to read the data or null if the table was empty
- * @param conflictDetectionFilter an expression on rows in the table
- * @return this for method chaining
- * @deprecated this will be removed in 0.11.0;
- * use {@link #validateNoConflictingAppends(Expression)} and {@link #validateFromSnapshot(long)} instead
- */
- @Deprecated
- OverwriteFiles validateNoConflictingAppends(Long readSnapshotId, Expression conflictDetectionFilter);
-
- /**
* Sets a conflict detection filter used to validate concurrently added data and delete files.
*
* @param conflictDetectionFilter an expression on rows in the table
diff --git a/api/src/main/java/org/apache/iceberg/transforms/PartitionSpecVisitor.java b/api/src/main/java/org/apache/iceberg/transforms/PartitionSpecVisitor.java
index 1770a22..230ee3f 100644
--- a/api/src/main/java/org/apache/iceberg/transforms/PartitionSpecVisitor.java
+++ b/api/src/main/java/org/apache/iceberg/transforms/PartitionSpecVisitor.java
@@ -99,25 +99,10 @@ public interface PartitionSpecVisitor<T> {
* @return a list of the result produced by visiting each partition field
*/
static <R> List<R> visit(PartitionSpec spec, PartitionSpecVisitor<R> visitor) {
- return visit(spec.schema(), spec, visitor);
- }
-
- /**
- * Visit the fields of a {@link PartitionSpec}.
- *
- * @param schema a schema for source field lookups
- * @param spec a partition spec to visit
- * @param visitor a partition spec visitor
- * @param <R> return type of the visitor
- * @return a list of the result produced by visiting each partition field
- * @deprecated this will be removed in 0.11.0; use {@link #visit(PartitionSpec, PartitionSpecVisitor)} instead.
- */
- @Deprecated
- static <R> List<R> visit(Schema schema, PartitionSpec spec, PartitionSpecVisitor<R> visitor) {
List<R> results = Lists.newArrayListWithExpectedSize(spec.fields().size());
for (PartitionField field : spec.fields()) {
- results.add(visit(schema, field, visitor));
+ results.add(visit(spec.schema(), field, visitor));
}
return results;
diff --git a/api/src/test/java/org/apache/iceberg/TestMetricsSerialization.java b/api/src/test/java/org/apache/iceberg/TestMetricsSerialization.java
index 96d6968..5748698 100644
--- a/api/src/test/java/org/apache/iceberg/TestMetricsSerialization.java
+++ b/api/src/test/java/org/apache/iceberg/TestMetricsSerialization.java
@@ -88,7 +88,7 @@ public class TestMetricsSerialization {
Map<Integer, ByteBuffer> byteMap2 = new HashMap<>();
byteMap1.put(3, ByteBuffer.wrap(new byte[] {1, 2}));
- return new Metrics(0L, longMap1, longMap2, longMap3, byteMap1, byteMap2);
+ return new Metrics(0L, longMap1, longMap2, longMap3, null, byteMap1, byteMap2);
}
private static Metrics generateMetricsWithNulls() {
@@ -100,7 +100,7 @@ public class TestMetricsSerialization {
byteMap.put(null, ByteBuffer.wrap(new byte[] {1, 2, 3}));
byteMap.put(4, null);
- return new Metrics(null, null, longMap, longMap, null, byteMap);
+ return new Metrics(null, null, longMap, longMap, null, null, byteMap);
}
private static void assertEquals(Metrics expected, Metrics actual) {
diff --git a/core/src/main/java/org/apache/iceberg/BaseOverwriteFiles.java b/core/src/main/java/org/apache/iceberg/BaseOverwriteFiles.java
index fa38ebf..2825091 100644
--- a/core/src/main/java/org/apache/iceberg/BaseOverwriteFiles.java
+++ b/core/src/main/java/org/apache/iceberg/BaseOverwriteFiles.java
@@ -78,16 +78,6 @@ public class BaseOverwriteFiles extends MergingSnapshotProducer<OverwriteFiles>
}
@Override
- @Deprecated
- public OverwriteFiles validateNoConflictingAppends(Long newReadSnapshotId, Expression newConflictDetectionFilter) {
- if (newReadSnapshotId != null) {
- validateFromSnapshot(newReadSnapshotId);
- }
- validateNoConflictingAppends(newConflictDetectionFilter);
- return this;
- }
-
- @Override
public OverwriteFiles validateFromSnapshot(long snapshotId) {
this.startingSnapshotId = snapshotId;
return this;
diff --git a/core/src/main/java/org/apache/iceberg/TableMetadataParser.java b/core/src/main/java/org/apache/iceberg/TableMetadataParser.java
index 29ad899..655a733 100644
--- a/core/src/main/java/org/apache/iceberg/TableMetadataParser.java
+++ b/core/src/main/java/org/apache/iceberg/TableMetadataParser.java
@@ -240,14 +240,6 @@ public class TableMetadataParser {
generator.writeEndObject();
}
- /**
- * @deprecated will be removed in 0.9.0; use read(FileIO, InputFile) instead.
- */
- @Deprecated
- public static TableMetadata read(TableOperations ops, InputFile file) {
- return read(ops.io(), file);
- }
-
public static TableMetadata read(FileIO io, String path) {
return read(io, io.newInputFile(path));
}
diff --git a/core/src/main/java/org/apache/iceberg/avro/AvroMetrics.java b/core/src/main/java/org/apache/iceberg/avro/AvroMetrics.java
index 83a3566..d0bf308 100644
--- a/core/src/main/java/org/apache/iceberg/avro/AvroMetrics.java
+++ b/core/src/main/java/org/apache/iceberg/avro/AvroMetrics.java
@@ -32,6 +32,6 @@ public class AvroMetrics {
static Metrics fromWriter(DatumWriter<?> datumWriter, Schema schema, long numRecords,
MetricsConfig inputMetricsConfig) {
// TODO will populate in following PRs if datum writer is a MetricsAwareDatumWriter
- return new Metrics(numRecords, null, null, null);
+ return new Metrics(numRecords, null, null, null, null);
}
}
diff --git a/core/src/test/java/org/apache/iceberg/TestFilterFiles.java b/core/src/test/java/org/apache/iceberg/TestFilterFiles.java
index e4c37af..e6b2915 100644
--- a/core/src/test/java/org/apache/iceberg/TestFilterFiles.java
+++ b/core/src/test/java/org/apache/iceberg/TestFilterFiles.java
@@ -105,7 +105,7 @@ public class TestFilterFiles {
upperBounds.put(1, Conversions.toByteBuffer(Types.IntegerType.get(), 2));
Metrics metrics = new Metrics(2L, Maps.newHashMap(), Maps.newHashMap(),
- Maps.newHashMap(), lowerBounds, upperBounds);
+ Maps.newHashMap(), null, lowerBounds, upperBounds);
DataFile file = DataFiles.builder(table.spec())
.withPath("/path/to/file.parquet")
@@ -131,7 +131,7 @@ public class TestFilterFiles {
upperBounds.put(1, Conversions.toByteBuffer(Types.IntegerType.get(), 2));
Metrics metrics = new Metrics(2L, Maps.newHashMap(), Maps.newHashMap(),
- Maps.newHashMap(), lowerBounds, upperBounds);
+ Maps.newHashMap(), null, lowerBounds, upperBounds);
DataFile file = DataFiles.builder(table.spec())
.withPath("/path/to/file.parquet")
diff --git a/core/src/test/java/org/apache/iceberg/TestFindFiles.java b/core/src/test/java/org/apache/iceberg/TestFindFiles.java
index 388534c..eb45c89 100644
--- a/core/src/test/java/org/apache/iceberg/TestFindFiles.java
+++ b/core/src/test/java/org/apache/iceberg/TestFindFiles.java
@@ -81,6 +81,7 @@ public class TestFindFiles extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 3L), // value count
ImmutableMap.of(1, 0L), // null count
+ null,
ImmutableMap.of(1, Conversions.toByteBuffer(Types.IntegerType.get(), 1)), // lower bounds
ImmutableMap.of(1, Conversions.toByteBuffer(Types.IntegerType.get(), 5)))) // lower bounds
.build())
diff --git a/core/src/test/java/org/apache/iceberg/TestOverwrite.java b/core/src/test/java/org/apache/iceberg/TestOverwrite.java
index 6512ea1..3292b60 100644
--- a/core/src/test/java/org/apache/iceberg/TestOverwrite.java
+++ b/core/src/test/java/org/apache/iceberg/TestOverwrite.java
@@ -61,6 +61,7 @@ public class TestOverwrite extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 5L, 2, 3L), // value count
ImmutableMap.of(1, 0L, 2, 2L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(0L)), // lower bounds
ImmutableMap.of(1, longToBuffer(4L)) // upper bounds
))
@@ -74,6 +75,7 @@ public class TestOverwrite extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 5L, 2, 3L), // value count
ImmutableMap.of(1, 0L, 2, 2L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(5L)), // lower bounds
ImmutableMap.of(1, longToBuffer(9L)) // upper bounds
))
@@ -87,6 +89,7 @@ public class TestOverwrite extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 5L, 2, 3L), // value count
ImmutableMap.of(1, 0L, 2, 2L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(5L)), // lower bounds
ImmutableMap.of(1, longToBuffer(9L)) // upper bounds
))
diff --git a/core/src/test/java/org/apache/iceberg/TestOverwriteWithValidation.java b/core/src/test/java/org/apache/iceberg/TestOverwriteWithValidation.java
index 3d2018f..a1dcece 100644
--- a/core/src/test/java/org/apache/iceberg/TestOverwriteWithValidation.java
+++ b/core/src/test/java/org/apache/iceberg/TestOverwriteWithValidation.java
@@ -67,6 +67,7 @@ public class TestOverwriteWithValidation extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 5L, 2, 3L), // value count
ImmutableMap.of(1, 0L, 2, 2L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(0L)), // lower bounds
ImmutableMap.of(1, longToBuffer(4L)) // upper bounds
))
@@ -89,6 +90,7 @@ public class TestOverwriteWithValidation extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 5L, 2, 3L), // value count
ImmutableMap.of(1, 0L, 2, 2L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(5L)), // lower bounds
ImmutableMap.of(1, longToBuffer(9L)) // upper bounds
))
@@ -119,6 +121,7 @@ public class TestOverwriteWithValidation extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 5L, 2, 3L), // value count
ImmutableMap.of(1, 0L, 2, 2L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(5L)), // lower bounds
ImmutableMap.of(1, longToBuffer(9L)) // upper bounds
))
@@ -133,6 +136,7 @@ public class TestOverwriteWithValidation extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 5L, 2, 3L), // value count
ImmutableMap.of(1, 0L, 2, 2L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(10L)), // lower bounds
ImmutableMap.of(1, longToBuffer(14L)) // upper bounds
))
@@ -148,6 +152,7 @@ public class TestOverwriteWithValidation extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 1L, 2, 1L), // value count
ImmutableMap.of(1, 0L, 2, 0L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(10L)), // lower bounds
ImmutableMap.of(1, longToBuffer(10L)) // upper bounds
))
@@ -198,7 +203,8 @@ public class TestOverwriteWithValidation extends TableTestBase {
table.newOverwrite()
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(null, alwaysTrue())
+ .conflictDetectionFilter(alwaysTrue())
+ .validateNoConflictingData()
.commit();
validateTableFiles(table, FILE_DAY_2_MODIFIED);
@@ -210,7 +216,8 @@ public class TestOverwriteWithValidation extends TableTestBase {
table.newOverwrite()
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(null, EXPRESSION_DAY_2)
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData()
.commit();
validateTableFiles(table, FILE_DAY_2_MODIFIED);
@@ -247,7 +254,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
table.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), alwaysTrue())
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(alwaysTrue())
+ .validateNoConflictingData()
.commit();
validateTableFiles(table, FILE_DAY_1, FILE_DAY_2_MODIFIED);
@@ -266,7 +275,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
table.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2)
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData()
.commit();
validateTableFiles(table, FILE_DAY_1, FILE_DAY_2_MODIFIED);
@@ -305,7 +316,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), alwaysTrue());
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(alwaysTrue())
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_1)
@@ -332,7 +345,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2);
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_1)
@@ -356,7 +371,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2);
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newDelete()
.deleteFile(FILE_DAY_1)
@@ -378,7 +395,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2);
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_2)
@@ -406,7 +425,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2);
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newDelete()
.deleteFile(FILE_DAY_2)
@@ -434,7 +455,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2);
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newRewrite()
.rewriteFiles(ImmutableSet.of(FILE_DAY_2), ImmutableSet.of(FILE_DAY_2))
@@ -458,7 +481,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2);
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_1)
@@ -486,7 +511,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2);
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newDelete()
.deleteFile(FILE_DAY_1)
@@ -510,7 +537,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
Snapshot baseSnapshot = table.currentSnapshot();
OverwriteFiles overwrite = table.newOverwrite()
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2);
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_2)
@@ -539,7 +568,8 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(null, EXPRESSION_DAY_2);
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_2)
@@ -568,7 +598,8 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = table.newOverwrite()
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(null, EXPRESSION_DAY_2_ID_RANGE);
+ .conflictDetectionFilter(EXPRESSION_DAY_2_ID_RANGE)
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_1)
@@ -586,7 +617,8 @@ public class TestOverwriteWithValidation extends TableTestBase {
Expression conflictDetectionFilter = and(EXPRESSION_DAY_2, EXPRESSION_DAY_2_ID_RANGE);
OverwriteFiles overwrite = table.newOverwrite()
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(null, conflictDetectionFilter);
+ .conflictDetectionFilter(conflictDetectionFilter)
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_2_ANOTHER_RANGE)
@@ -611,7 +643,9 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = txn.newOverwrite()
.deleteFile(FILE_DAY_2)
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(baseSnapshot.snapshotId(), EXPRESSION_DAY_2);
+ .validateFromSnapshot(baseSnapshot.snapshotId())
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_1)
@@ -635,7 +669,8 @@ public class TestOverwriteWithValidation extends TableTestBase {
OverwriteFiles overwrite = txn.newOverwrite()
.addFile(FILE_DAY_2_MODIFIED)
- .validateNoConflictingAppends(null, EXPRESSION_DAY_2);
+ .conflictDetectionFilter(EXPRESSION_DAY_2)
+ .validateNoConflictingData();
table.newAppend()
.appendFile(FILE_DAY_2)
diff --git a/core/src/test/java/org/apache/iceberg/TestScanDataFileColumns.java b/core/src/test/java/org/apache/iceberg/TestScanDataFileColumns.java
index 2f3fcf3..bb021f4 100644
--- a/core/src/test/java/org/apache/iceberg/TestScanDataFileColumns.java
+++ b/core/src/test/java/org/apache/iceberg/TestScanDataFileColumns.java
@@ -69,6 +69,7 @@ public class TestScanDataFileColumns {
ImmutableMap.of(1, 50L), // column size
ImmutableMap.of(1, 3L), // value count
ImmutableMap.of(1, 0L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(0L)), // lower bounds
ImmutableMap.of(1, longToBuffer(2L)))) // upper bounds)
.build())
@@ -79,6 +80,7 @@ public class TestScanDataFileColumns {
ImmutableMap.of(1, 60L), // column size
ImmutableMap.of(1, 3L), // value count
ImmutableMap.of(1, 0L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(10L)), // lower bounds
ImmutableMap.of(1, longToBuffer(12L)))) // upper bounds)
.build())
@@ -89,6 +91,7 @@ public class TestScanDataFileColumns {
ImmutableMap.of(1, 70L), // column size
ImmutableMap.of(1, 3L), // value count
ImmutableMap.of(1, 0L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(20L)), // lower bounds
ImmutableMap.of(1, longToBuffer(22L)))) // upper bounds)
.build())
diff --git a/core/src/test/java/org/apache/iceberg/TestSnapshotSelection.java b/core/src/test/java/org/apache/iceberg/TestSnapshotSelection.java
index ddbb874..75ebd23 100644
--- a/core/src/test/java/org/apache/iceberg/TestSnapshotSelection.java
+++ b/core/src/test/java/org/apache/iceberg/TestSnapshotSelection.java
@@ -69,6 +69,7 @@ public class TestSnapshotSelection extends TableTestBase {
null, // no column sizes
ImmutableMap.of(1, 3L), // value count
ImmutableMap.of(1, 0L), // null count
+ null,
ImmutableMap.of(1, longToBuffer(20L)), // lower bounds
ImmutableMap.of(1, longToBuffer(22L)))) // upper bounds
.build();
diff --git a/data/src/main/java/org/apache/iceberg/data/TableMigrationUtil.java b/data/src/main/java/org/apache/iceberg/data/TableMigrationUtil.java
index a432c76..c534c70 100644
--- a/data/src/main/java/org/apache/iceberg/data/TableMigrationUtil.java
+++ b/data/src/main/java/org/apache/iceberg/data/TableMigrationUtil.java
@@ -95,7 +95,7 @@ public class TableMigrationUtil {
.map(stat -> {
InputFile file = HadoopInputFile.fromLocation(stat.getPath().toString(), conf);
long rowCount = Avro.rowCount(file);
- Metrics metrics = new Metrics(rowCount, null, null, null);
+ Metrics metrics = new Metrics(rowCount, null, null, null, null);
String partitionKey = spec.fields().stream()
.map(PartitionField::name)
.map(name -> String.format("%s=%s", name, partitionPath.get(name)))