Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 35 additions & 15 deletions .palantir/revapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ versionOverrides:
acceptedBreaks:
apache-iceberg-0.14.0:
org.apache.iceberg:iceberg-api:
- code: "java.class.removed"
old: "interface org.apache.iceberg.Rollback"
justification: "Deprecations for 1.0 release"
- code: "java.method.addedToInterface"
new: "method java.lang.String org.apache.iceberg.expressions.Reference<T>::name()"
justification: "All subclasses implement name"
- code: "java.method.removed"
old: "method org.apache.iceberg.OverwriteFiles org.apache.iceberg.OverwriteFiles::validateNoConflictingAppends(org.apache.iceberg.expressions.Expression)"
justification: "Deprecations for 1.0 release"
- code: "java.method.removed"
old: "method org.apache.iceberg.Rollback org.apache.iceberg.Table::rollback()"
justification: "Deprecations for 1.0 release"
- code: "java.method.removed"
old: "method org.apache.iceberg.RowDelta org.apache.iceberg.RowDelta::validateNoConflictingAppends(org.apache.iceberg.expressions.Expression)"
justification: "Deprecations for 1.0 release"
release-base-0.13.0:
org.apache.iceberg:iceberg-api:
- code: "java.class.defaultSerializationChanged"
Expand Down Expand Up @@ -35,6 +47,10 @@ acceptedBreaks:
- code: "java.method.addedToInterface"
new: "method ThisT org.apache.iceberg.SnapshotUpdate<ThisT>::toBranch(java.lang.String)"
justification: "Adding toBranch API for supporting committing to a branch"
- code: "java.method.addedToInterface"
new: "method boolean org.apache.iceberg.Scan<ThisT, T extends org.apache.iceberg.ScanTask,\
\ G extends org.apache.iceberg.ScanTaskGroup<T extends org.apache.iceberg.ScanTask>>::isCaseSensitive()"
justification: "Move a method to the parent interface"
- code: "java.method.addedToInterface"
new: "method boolean org.apache.iceberg.expressions.BoundTerm<T>::isEquivalentTo(org.apache.iceberg.expressions.BoundTerm<?>)"
justification: "new API method"
Expand All @@ -54,20 +70,25 @@ acceptedBreaks:
new: "method java.util.List<org.apache.iceberg.ManifestFile> org.apache.iceberg.Snapshot::deleteManifests(org.apache.iceberg.io.FileIO)"
justification: "Allow adding a new method to the interface - old method is deprecated"
- code: "java.method.addedToInterface"
new: "method java.util.Map<java.lang.String, org.apache.iceberg.SnapshotRef> org.apache.iceberg.Table::refs()"
new: "method java.util.Map<java.lang.String, org.apache.iceberg.SnapshotRef>\
\ org.apache.iceberg.Table::refs()"
justification: "Adding new refs method to Table API for easier access"
- code: "java.method.addedToInterface"
new: "method long org.apache.iceberg.actions.ExpireSnapshots.Result::deletedEqualityDeleteFilesCount()"
justification: "Interface is backward compatible, very unlikely anyone implements this Result bean interface"
- code: "java.method.addedToInterface"
new: "method long org.apache.iceberg.actions.ExpireSnapshots.Result::deletedPositionDeleteFilesCount()"
justification: "Interface is backward compatible, very unlikely anyone implements this Result bean interface"
- code: "java.method.addedToInterface"
new: "method long org.apache.iceberg.actions.DeleteReachableFiles.Result::deletedEqualityDeleteFilesCount()"
justification: "Interface is backward compatible, very unlikely anyone implements this Result bean interface"
justification: "Interface is backward compatible, very unlikely anyone implements\
\ this Result bean interface"
- code: "java.method.addedToInterface"
new: "method long org.apache.iceberg.actions.DeleteReachableFiles.Result::deletedPositionDeleteFilesCount()"
justification: "Interface is backward compatible, very unlikely anyone implements this Result bean interface"
justification: "Interface is backward compatible, very unlikely anyone implements\
\ this Result bean interface"
- code: "java.method.addedToInterface"
new: "method long org.apache.iceberg.actions.ExpireSnapshots.Result::deletedEqualityDeleteFilesCount()"
justification: "Interface is backward compatible, very unlikely anyone implements\
\ this Result bean interface"
- code: "java.method.addedToInterface"
new: "method long org.apache.iceberg.actions.ExpireSnapshots.Result::deletedPositionDeleteFilesCount()"
justification: "Interface is backward compatible, very unlikely anyone implements\
\ this Result bean interface"
- code: "java.method.addedToInterface"
new: "method org.apache.iceberg.ExpireSnapshots org.apache.iceberg.ExpireSnapshots::planWith(java.util.concurrent.ExecutorService)"
justification: "Accept all changes prior to introducing API compatibility checks"
Expand Down Expand Up @@ -126,6 +147,11 @@ acceptedBreaks:
- code: "java.method.addedToInterface"
new: "method org.apache.iceberg.ReplacePartitions org.apache.iceberg.ReplacePartitions::validateNoConflictingDeletes()"
justification: "Accept all changes prior to introducing API compatibility checks"
- code: "java.method.addedToInterface"
new: "method org.apache.iceberg.expressions.Expression org.apache.iceberg.Scan<ThisT,\
\ T extends org.apache.iceberg.ScanTask, G extends org.apache.iceberg.ScanTaskGroup<T\
\ extends org.apache.iceberg.ScanTask>>::filter()"
justification: "Move a method to the parent interface"
- code: "java.method.numberOfParametersChanged"
old: "method void org.apache.iceberg.events.IncrementalScanEvent::<init>(java.lang.String,\
\ long, long, org.apache.iceberg.expressions.Expression, org.apache.iceberg.Schema)"
Expand All @@ -134,9 +160,3 @@ acceptedBreaks:
\ boolean)"
justification: "IncrementalScanEvent should only be constructed by Iceberg code.\
\ Hence the change of constructor params shouldn't affect users"
- code: "java.method.addedToInterface"
new: "method org.apache.iceberg.expressions.Expression org.apache.iceberg.Scan<ThisT, T extends org.apache.iceberg.ScanTask, G extends org.apache.iceberg.ScanTaskGroup<T extends org.apache.iceberg.ScanTask>>::filter()"
justification: "Move a method to the parent interface"
- code: "java.method.addedToInterface"
new: "method boolean org.apache.iceberg.Scan<ThisT, T extends org.apache.iceberg.ScanTask, G extends org.apache.iceberg.ScanTaskGroup<T extends org.apache.iceberg.ScanTask>>::isCaseSensitive()"
justification: "Move a method to the parent interface"
26 changes: 0 additions & 26 deletions api/src/main/java/org/apache/iceberg/OverwriteFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,32 +105,6 @@ public interface OverwriteFiles extends SnapshotUpdate<OverwriteFiles> {
*/
OverwriteFiles caseSensitive(boolean caseSensitive);

/**
* Enables validation that data files added concurrently do not conflict with this commit's
* operation.
*
* <p>This method should be called while committing non-idempotent overwrite operations. 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
* and fail.
*
* <p>Calling this method with a correct conflict detection filter is required to maintain
* serializable isolation for overwrite operations. Otherwise, the isolation level will be
* snapshot isolation.
*
* <p>Validation applies to files added to the table since the snapshot passed to {@link
* #validateFromSnapshot(long)}.
*
* @param conflictDetectionFilter an expression on rows in the table
* @return this for method chaining
* @deprecated since 0.13.0, will be removed in 0.14.0; use {@link
* #conflictDetectionFilter(Expression)} and {@link #validateNoConflictingData()} instead.
*/
@Deprecated
default OverwriteFiles validateNoConflictingAppends(Expression conflictDetectionFilter) {
return conflictDetectionFilter(conflictDetectionFilter).validateNoConflictingData();
}

/**
* Sets a conflict detection filter used to validate concurrently added data and delete files.
*
Expand Down
55 changes: 0 additions & 55 deletions api/src/main/java/org/apache/iceberg/Rollback.java

This file was deleted.

28 changes: 0 additions & 28 deletions api/src/main/java/org/apache/iceberg/RowDelta.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,6 @@ public interface RowDelta extends SnapshotUpdate<RowDelta> {
*/
RowDelta validateDeletedFiles();

/**
* Enables validation that data 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 update/delete operations. Otherwise, the isolation level will be
* snapshot isolation.
*
* <p>Validation applies to files added to the table since the snapshot passed to {@link
* #validateFromSnapshot(long)}.
*
* @param conflictDetectionFilter an expression on rows in the table
* @return this for method chaining
* @deprecated since 0.13.0, will be removed in 0.14.0; use {@link
* #conflictDetectionFilter(Expression)} and {@link #validateNoConflictingDataFiles()}
* instead.
*/
@Deprecated
default RowDelta validateNoConflictingAppends(Expression conflictDetectionFilter) {
conflictDetectionFilter(conflictDetectionFilter);
return validateNoConflictingDataFiles();
}

/**
* Sets a conflict detection filter used to validate concurrently added data and delete files.
*
Expand Down
9 changes: 0 additions & 9 deletions api/src/main/java/org/apache/iceberg/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,6 @@ default AppendFiles newFastAppend() {
*/
ExpireSnapshots expireSnapshots();

/**
* Create a new {@link Rollback rollback API} to roll back to a previous snapshot and commit.
*
* @return a new {@link Rollback}
* @deprecated Replaced by {@link #manageSnapshots()}
*/
@Deprecated
Rollback rollback();

/**
* Create a new {@link ManageSnapshots manage snapshots API} to manage snapshots in this table and
* commit.
Expand Down
5 changes: 0 additions & 5 deletions core/src/main/java/org/apache/iceberg/BaseMetadataTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,6 @@ public ExpireSnapshots expireSnapshots() {
throw new UnsupportedOperationException("Cannot expire snapshots from a metadata table");
}

@Override
public Rollback rollback() {
throw new UnsupportedOperationException("Cannot roll back a metadata table");
}

@Override
public ManageSnapshots manageSnapshots() {
throw new UnsupportedOperationException("Cannot manage snapshots in a metadata table");
Expand Down
5 changes: 0 additions & 5 deletions core/src/main/java/org/apache/iceberg/BaseTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@ public ExpireSnapshots expireSnapshots() {
return new RemoveSnapshots(ops);
}

@Override
public Rollback rollback() {
return new RollbackToSnapshot(name, ops);
}

@Override
public ManageSnapshots manageSnapshots() {
return new SnapshotManager(name, ops);
Expand Down
5 changes: 0 additions & 5 deletions core/src/main/java/org/apache/iceberg/BaseTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -716,11 +716,6 @@ public ExpireSnapshots expireSnapshots() {
return BaseTransaction.this.expireSnapshots();
}

@Override
public Rollback rollback() {
throw new UnsupportedOperationException("Transaction tables do not support rollback");
}

@Override
public ManageSnapshots manageSnapshots() {
throw new UnsupportedOperationException(
Expand Down
38 changes: 0 additions & 38 deletions core/src/main/java/org/apache/iceberg/RollbackToSnapshot.java

This file was deleted.

5 changes: 0 additions & 5 deletions core/src/main/java/org/apache/iceberg/SerializableTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,6 @@ public ExpireSnapshots expireSnapshots() {
throw new UnsupportedOperationException(errorMsg("expireSnapshots"));
}

@Override
public Rollback rollback() {
throw new UnsupportedOperationException(errorMsg("rollback"));
}

@Override
public ManageSnapshots manageSnapshots() {
throw new UnsupportedOperationException(errorMsg("manageSnapshots"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void testRollbacks() {
add(table.newAppend(), files("B"));
add(table.newAppend(), files("C")); // 3
// Go back to snapshot "B"
table.rollback().toSnapshotId(2).commit(); // 2
table.manageSnapshots().rollbackTo(2).commit(); // 2
Assert.assertEquals(2, table.currentSnapshot().snapshotId());
filesMatch(Lists.newArrayList("B"), appendsBetweenScan(1, 2));
filesMatch(Lists.newArrayList("B"), appendsAfterScan(1));
Expand All @@ -201,7 +201,7 @@ public void testRollbacks() {
add(transaction.newAppend(), files("F"));
transaction.commitTransaction();
// Go back to snapshot "E"
table.rollback().toSnapshotId(5).commit();
table.manageSnapshots().rollbackTo(5).commit();
Assert.assertEquals(5, table.currentSnapshot().snapshotId());
filesMatch(Lists.newArrayList("B", "D", "E"), appendsBetweenScan(1, 5));
filesMatch(Lists.newArrayList("B", "D", "E"), appendsAfterScan(1));
Expand Down
15 changes: 10 additions & 5 deletions core/src/test/java/org/apache/iceberg/TestRowDelta.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ public void testValidateNoConflicts() {
.newRowDelta()
.addDeletes(FILE_A_DELETES)
.validateFromSnapshot(validateFromSnapshotId)
.validateNoConflictingAppends(Expressions.equal("data", "u")) // bucket16("u") -> 0
.conflictDetectionFilter(Expressions.equal("data", "u")) // bucket16("u") -> 0
.validateNoConflictingDataFiles()
.commit());

Assert.assertEquals(
Expand Down Expand Up @@ -383,7 +384,8 @@ public void testValidateNoConflictsFromSnapshot() {
.validateDeletedFiles()
.validateFromSnapshot(validateFromSnapshotId)
.validateDataFilesExist(ImmutableList.of(FILE_A.path()))
.validateNoConflictingAppends(Expressions.equal("data", "u")) // bucket16("u") -> 0
.conflictDetectionFilter(Expressions.equal("data", "u")) // bucket16("u") -> 0
.validateNoConflictingDataFiles()
.commit();

Snapshot snap = table.currentSnapshot();
Expand Down Expand Up @@ -741,7 +743,8 @@ public void testValidateDataFilesExistWithConflictDetectionFilter() {
.validateDataFilesExist(ImmutableList.of(dataFile1.path()))
.validateDeletedFiles()
.validateFromSnapshot(baseSnapshot.snapshotId())
.validateNoConflictingAppends(conflictDetectionFilter);
.conflictDetectionFilter(conflictDetectionFilter)
.validateNoConflictingDataFiles();

// concurrently delete the file for partition B
table.newDelete().deleteFile(dataFile2).commit();
Expand Down Expand Up @@ -803,7 +806,8 @@ public void testValidateDataFilesDoNotExistWithConflictDetectionFilter() {
.validateDataFilesExist(ImmutableList.of(dataFile1.path()))
.validateDeletedFiles()
.validateFromSnapshot(baseSnapshot.snapshotId())
.validateNoConflictingAppends(conflictDetectionFilter);
.conflictDetectionFilter(conflictDetectionFilter)
.validateNoConflictingDataFiles();

// concurrently delete the file for partition A
table.newDelete().deleteFile(dataFile1).commit();
Expand Down Expand Up @@ -1077,7 +1081,8 @@ public void testConcurrentConflictingRowDelta() {
.newRowDelta()
.addDeletes(FILE_A_DELETES)
.validateFromSnapshot(firstSnapshot.snapshotId())
.validateNoConflictingAppends(conflictDetectionFilter)
.conflictDetectionFilter(conflictDetectionFilter)
.validateNoConflictingDataFiles()
.commit();

AssertHelpers.assertThrows(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void before() throws IOException {
public void rollbackToPreviousSnapshotAndReadData() {
long oldId = table.history().get(0).snapshotId();

table.rollback().toSnapshotId(oldId).commit();
table.manageSnapshots().rollbackTo(oldId).commit();
table.refresh();

Dataset<Row> results = spark.read().format("iceberg").load(tableLocation.toString());
Expand Down
Loading