Skip to content

Commit

Permalink
HIVE-26675: Update Iceberg from 0.14.1 to 1.0.0 (#3711)
Browse files Browse the repository at this point in the history
Contributed by zhangbutao
  • Loading branch information
zhangbutao committed Oct 31, 2022
1 parent 856d807 commit f8a6fd6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void testCreateTableTxnAndAppend() {

Table table = catalog.loadTable(TABLE_IDENTIFIER);
Snapshot snapshot = table.currentSnapshot();
Assert.assertTrue("Table should have one manifest file", snapshot.allManifests().size() == 1);
Assert.assertTrue("Table should have one manifest file", snapshot.allManifests(table.io()).size() == 1);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void testDropTable() throws IOException {

String manifestListLocation = table.currentSnapshot().manifestListLocation().replace("file:", "");

List<ManifestFile> manifests = table.currentSnapshot().allManifests();
List<ManifestFile> manifests = table.currentSnapshot().allManifests(table.io());

Assert.assertTrue("Drop (table and data) should return true and drop the table",
catalog.dropTable(TABLE_IDENTIFIER));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public synchronized void testConcurrentFastAppends() {
});

icebergTable.refresh();
Assert.assertEquals(20, icebergTable.currentSnapshot().allManifests().size());
Assert.assertEquals(20, icebergTable.currentSnapshot().allManifests(icebergTable.io()).size());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ public void validateSinkDesc(FileSinkDesc sinkDesc) throws SemanticException {
throw new SemanticException("Cannot perform insert overwrite query on bucket partitioned Iceberg table.");
}
if (table.currentSnapshot() != null) {
if (table.currentSnapshot().allManifests().parallelStream().map(ManifestFile::partitionSpecId)
if (table.currentSnapshot().allManifests(table.io()).parallelStream().map(ManifestFile::partitionSpecId)
.anyMatch(id -> id < table.spec().specId())) {
throw new SemanticException(
"Cannot perform insert overwrite query on Iceberg table where partition evolution happened. In order " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void testReadAndWriteFormatV2Unpartitioned_PosDelete() throws IOException
PartitionSpec.unpartitioned(), fileFormat, HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS, 2);

// delete one of the rows
DataFile dataFile = StreamSupport.stream(tbl.currentSnapshot().addedFiles().spliterator(), false)
DataFile dataFile = StreamSupport.stream(tbl.currentSnapshot().addedDataFiles(tbl.io()).spliterator(), false)
.findFirst()
.orElseThrow(() -> new RuntimeException("Did not find any data files for test table"));
List<PositionDelete<Record>> deletes = ImmutableList.of(positionDelete(
Expand Down Expand Up @@ -172,7 +172,7 @@ public void testReadAndWriteFormatV2Partitioned_PosDelete_RowNotSupplied() throw
tbl.refresh();

// delete the first and third rows from the newly-added data file - with row supplied
DataFile dataFile = StreamSupport.stream(tbl.currentSnapshot().addedFiles().spliterator(), false)
DataFile dataFile = StreamSupport.stream(tbl.currentSnapshot().addedDataFiles(tbl.io()).spliterator(), false)
.filter(file -> file.partition().get(0, Long.class) == 0L)
.filter(file -> file.recordCount() == 3)
.findAny()
Expand Down Expand Up @@ -210,7 +210,7 @@ public void testReadAndWriteFormatV2Partitioned_PosDelete_RowSupplied() throws I
tbl.refresh();

// delete the first and third rows from the newly-added data file
DataFile dataFile = StreamSupport.stream(tbl.currentSnapshot().addedFiles().spliterator(), false)
DataFile dataFile = StreamSupport.stream(tbl.currentSnapshot().addedDataFiles(tbl.io()).spliterator(), false)
.filter(file -> file.partition().get(0, Long.class) == 0L)
.filter(file -> file.recordCount() == 3)
.findAny()
Expand Down
2 changes: 1 addition & 1 deletion iceberg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<properties>
<hive.path.to.root>..</hive.path.to.root>
<path.to.iceberg.root>.</path.to.iceberg.root>
<iceberg.version>0.14.1</iceberg.version>
<iceberg.version>1.0.0</iceberg.version>
<kryo-shaded.version>4.0.2</kryo-shaded.version>
<iceberg.mockito-core.version>3.4.4</iceberg.mockito-core.version>
<iceberg.avro.version>1.9.2</iceberg.avro.version>
Expand Down

0 comments on commit f8a6fd6

Please sign in to comment.