Skip to content

Commit

Permalink
[Improvement]: Upgrade to iceberg 1.6.1 (#3084)
Browse files Browse the repository at this point in the history
  • Loading branch information
czy006 committed Jan 14, 2025
1 parent c72f121 commit 23c33cf
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.amoro.table.MixedTable;
import org.apache.amoro.utils.map.StructLikeCollections;
import org.apache.iceberg.PartitionSpec;
import org.apache.iceberg.StructLike;
import org.apache.iceberg.TableProperties;
import org.apache.iceberg.data.GenericAppenderFactory;
import org.apache.iceberg.data.IdentityPartitionConverters;
Expand All @@ -46,18 +45,6 @@ public IcebergRewriteExecutor(
super(input, table, structLikeCollections);
}

// TODO We can remove this override method after upgrading Iceberg version to 1.5+.
@Override
protected StructLike partition() {
StructLike partitionData = super.partition();
if (partitionData != null && partitionData.size() == 0) {
// Cast empty partition data to NULL to avoid creating empty partition directory.
return null;
} else {
return partitionData;
}
}

@Override
protected OptimizingDataReader dataReader() {
return new GenericCombinedIcebergDataReader(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

import java.util.List;
import java.util.Map;
import java.util.UUID;

/** Basic implementation of {@link UnkeyedTable}, wrapping a {@link Table}. */
public class BasicUnkeyedTable implements UnkeyedTable, HasTableOperations {
Expand Down Expand Up @@ -318,4 +319,9 @@ public StructLikeMap<Map<String, String>> partitionProperty() {
public UpdatePartitionProperties updatePartitionProperties(Transaction transaction) {
return new PartitionPropertiesUpdate(this, transaction);
}

@Override
public UUID uuid() {
return UUID.fromString(this.operations().current().uuid());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,44 @@
import org.apache.iceberg.expressions.Expressions;
import org.apache.iceberg.types.Conversions;
import org.apache.iceberg.types.Types;
import org.junit.After;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.List;
import java.util.Set;

@RunWith(Parameterized.class)
public class TestIcebergFindFiles extends TableTestBase {
public class TestIcebergFindFiles extends TestBase {

@Parameterized.Parameters(name = "formatVersion = {0}")
public static Object[] parameters() {
return new Object[] {1, 2};
public static List<Object> parameters() {
return Arrays.asList(1, 2);
}

@Rule public TemporaryFolder tempDir = new TemporaryFolder();

public TestIcebergFindFiles(int formatVersion) {
super(formatVersion);
this.formatVersion = formatVersion;
}

@Before
public void setUp() throws Exception {
this.tableDir = tempDir.newFolder();
this.tableDir.delete();
super.setupTable();
}

@After
public void cleanUp() throws Exception {
super.cleanupTables();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<packaging>jar</packaging>

<properties>
<iceberg.version>1.4.3</iceberg.version>
<kafka.version>2.8.1</kafka.version>
<assertj.version>3.21.0</assertj.version>
<testcontainers.version>1.17.2</testcontainers.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<packaging>jar</packaging>

<properties>
<iceberg.version>1.4.3</iceberg.version>
<kafka.version>3.2.3</kafka.version>
<assertj.version>3.21.0</assertj.version>
<testcontainers.version>1.17.2</testcontainers.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<packaging>jar</packaging>

<properties>
<iceberg.version>1.4.3</iceberg.version>
<kafka.version>3.2.3</kafka.version>
<assertj.version>3.21.0</assertj.version>
<testcontainers.version>1.17.2</testcontainers.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<url>https://amoro.apache.org</url>

<properties>
<iceberg.version>1.4.3</iceberg.version>
<spark.version>3.2.4</spark.version>
<scala.version>2.12.15</scala.version>
</properties>
Expand Down Expand Up @@ -144,7 +145,7 @@

<dependency>
<groupId>org.apache.iceberg</groupId>
<artifactId>iceberg-spark-3.2_2.12</artifactId>
<artifactId>iceberg-spark-3.3_2.12</artifactId>
<version>${iceberg.version}</version>
<scope>provided</scope>
<exclusions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<url>https://amoro.apache.org</url>

<properties>
<iceberg.version>1.4.3</iceberg.version>
<hive.version>2.3.9</hive.version>
<spark.version>3.2.4</spark.version>
<scala.version>2.12.15</scala.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<url>https://amoro.apache.org</url>

<properties>
<iceberg.version>1.4.3</iceberg.version>
<hive.version>2.3.9</hive.version>
<spark.version>3.3.2</spark.version>
<scala.version>2.12.15</scala.version>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<maven-clean-plugin.version>3.3.2</maven-clean-plugin.version>
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>

<iceberg.version>1.4.3</iceberg.version>
<iceberg.version>1.6.1</iceberg.version>
<paimon.version>0.9.0</paimon.version>
<hive.version>3.1.1</hive.version>
<hadoop.version>3.4.0</hadoop.version>
Expand Down Expand Up @@ -1356,8 +1356,8 @@
<guava.version>14.0.1</guava.version>
<hive.version>2.3.9</hive.version>
<hadoop.version>2.10.2</hadoop.version>
<terminal.spark.version>3.2.4</terminal.spark.version>
<terminal.spark.major.version>3.2</terminal.spark.major.version>
<terminal.spark.version>3.3.3</terminal.spark.version>
<terminal.spark.major.version>3.3</terminal.spark.major.version>
</properties>
</profile>
<profile>
Expand Down

0 comments on commit 23c33cf

Please sign in to comment.