Skip to content

Commit 78463cd

Browse files
authored
feat: Upgrade iceberg-java to 1.9.2 and support adding required columns (#145)
1 parent 4408e26 commit 78463cd

15 files changed

Lines changed: 860 additions & 211 deletions

File tree

.github/workflows/verify.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ jobs:
5555
run: >
5656
./mvnw -pl ice-rest-catalog -am install -DskipTests=true -Pno-check &&
5757
./mvnw -pl ice-rest-catalog failsafe:integration-test failsafe:verify
58-
-Dit.test=DockerScenarioBasedIT,DockerLocalFileIOClickHouseIT
58+
-Dit.test=DockerScenarioBasedIT,DockerLocalFileIOClickHouseIT,DockerLocalFileIOClickHouseAllTypesIT
5959
-Ddocker.image=altinity/ice-rest-catalog:debug-with-ice-latest-master-amd64
6060
-Dclickhouse.image=altinity/clickhouse-server:25.8.16.20002.altinityantalya

ice-rest-catalog/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,18 @@
244244
<groupId>com.fasterxml.jackson.core</groupId>
245245
<artifactId>jackson-core</artifactId>
246246
</exclusion>
247+
<exclusion>
248+
<groupId>com.fasterxml.jackson.core</groupId>
249+
<artifactId>jackson-databind</artifactId>
250+
</exclusion>
251+
<exclusion>
252+
<groupId>com.fasterxml.jackson.core</groupId>
253+
<artifactId>jackson-annotations</artifactId>
254+
</exclusion>
255+
<exclusion>
256+
<groupId>com.fasterxml.jackson.datatype</groupId>
257+
<artifactId>jackson-datatype-jsr310</artifactId>
258+
</exclusion>
247259
<exclusion>
248260
<groupId>com.google.errorprone</groupId>
249261
<artifactId>error_prone_annotations</artifactId>
@@ -577,6 +589,7 @@
577589
<excludes>
578590
<exclude>**/DockerScenarioBasedIT.java</exclude>
579591
<exclude>**/DockerLocalFileIOClickHouseIT.java</exclude>
592+
<exclude>**/DockerLocalFileIOClickHouseAllTypesIT.java</exclude>
580593
</excludes>
581594
</configuration>
582595
</plugin>

ice-rest-catalog/src/main/java/org/apache/iceberg/BaseMetastoreTableOperations.java

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.concurrent.atomic.AtomicReference;
2424
import java.util.function.Function;
2525
import java.util.function.Predicate;
26+
import org.apache.iceberg.BaseMetastoreOperations.CommitStatus;
2627
import org.apache.iceberg.encryption.EncryptionManager;
2728
import org.apache.iceberg.exceptions.AlreadyExistsException;
2829
import org.apache.iceberg.exceptions.CommitFailedException;
@@ -294,20 +295,39 @@ public long newSnapshotId() {
294295
* were attempting to set. This is used as a last resort when we are dealing with exceptions that
295296
* may indicate the commit has failed but are not proof that this is the case. Past locations must
296297
* also be searched on the chance that a second committer was able to successfully commit on top
297-
* of our commit.
298+
* of our commit. When the {@code newMetadataLocation} is not found, the method returns {@link
299+
* CommitStatus#UNKNOWN}.
298300
*
299301
* @param newMetadataLocation the path of the new commit file
300302
* @param config metadata to use for configuration
301-
* @return Commit Status of Success, Failure or Unknown
303+
* @return Commit Status of Success, Unknown
302304
*/
303305
protected CommitStatus checkCommitStatus(String newMetadataLocation, TableMetadata config) {
304-
return CommitStatus.valueOf(
305-
checkCommitStatus(
306-
tableName(),
307-
newMetadataLocation,
308-
config.properties(),
309-
() -> checkCurrentMetadataLocation(newMetadataLocation))
310-
.name());
306+
return checkCommitStatus(
307+
tableName(),
308+
newMetadataLocation,
309+
config.properties(),
310+
() -> checkCurrentMetadataLocation(newMetadataLocation));
311+
}
312+
313+
/**
314+
* Attempt to load the table and see if any current or past metadata location matches the one we
315+
* were attempting to set. This is used as a last resort when we are dealing with exceptions that
316+
* may indicate the commit has failed but are not proof that this is the case. Past locations must
317+
* also be searched on the chance that a second committer was able to successfully commit on top
318+
* of our commit. When the {@code newMetadataLocation} is not found, the method returns {@link
319+
* CommitStatus#FAILURE}.
320+
*
321+
* @param newMetadataLocation the path of the new commit file
322+
* @param config metadata to use for configuration
323+
* @return Commit Status of Success, Failure or Unknown
324+
*/
325+
protected CommitStatus checkCommitStatusStrict(String newMetadataLocation, TableMetadata config) {
326+
return checkCommitStatusStrict(
327+
tableName(),
328+
newMetadataLocation,
329+
config.properties(),
330+
() -> checkCurrentMetadataLocation(newMetadataLocation));
311331
}
312332

313333
/**

0 commit comments

Comments
 (0)