diff --git a/catalogs/catalog-lakehouse-iceberg/src/main/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/IcebergTable.java b/catalogs/catalog-lakehouse-iceberg/src/main/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/IcebergTable.java index 6fc13444431..23036a8c875 100644 --- a/catalogs/catalog-lakehouse-iceberg/src/main/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/IcebergTable.java +++ b/catalogs/catalog-lakehouse-iceberg/src/main/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/IcebergTable.java @@ -72,7 +72,7 @@ public CreateTableRequest toCreateTableRequest() { } /** - * Transforms the gravitino distribution to the distribution mode name of the iceberg table. + * Transforms the gravitino distribution to the distribution mode name of the Iceberg table. * * @param distribution The distribution of the table. * @return The distribution mode name of the iceberg table. diff --git a/catalogs/catalog-lakehouse-iceberg/src/test/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/TestIcebergTable.java b/catalogs/catalog-lakehouse-iceberg/src/test/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/TestIcebergTable.java index a431ec86cb5..90eaab4ea2e 100644 --- a/catalogs/catalog-lakehouse-iceberg/src/test/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/TestIcebergTable.java +++ b/catalogs/catalog-lakehouse-iceberg/src/test/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/TestIcebergTable.java @@ -39,6 +39,7 @@ import java.util.UUID; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.iceberg.DistributionMode; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; @@ -554,7 +555,9 @@ public void testTableDistribution() { .withColumns(icebergColumns.toArray(new IcebergColumn[0])) .withComment("test_table") .build(); - Assertions.assertDoesNotThrow(() -> icebergTable.transformDistribution(Distributions.NONE)); + String none = + Assertions.assertDoesNotThrow(() -> icebergTable.transformDistribution(Distributions.NONE)); + Assertions.assertEquals(none, DistributionMode.NONE.modeName()); IllegalArgumentException illegalArgumentException = Assertions.assertThrows( @@ -591,9 +594,15 @@ public void testTableDistribution() { .withColumns(icebergColumns.toArray(new IcebergColumn[0])) .withComment("test_table2") .build(); - Assertions.assertDoesNotThrow(() -> newTable.transformDistribution(Distributions.NONE)); - Assertions.assertDoesNotThrow(() -> newTable.transformDistribution(Distributions.HASH)); - Assertions.assertDoesNotThrow(() -> newTable.transformDistribution(Distributions.RANGE)); + String distributionName = + Assertions.assertDoesNotThrow(() -> newTable.transformDistribution(Distributions.NONE)); + Assertions.assertEquals(distributionName, DistributionMode.NONE.modeName()); + distributionName = + Assertions.assertDoesNotThrow(() -> newTable.transformDistribution(Distributions.HASH)); + Assertions.assertEquals(distributionName, DistributionMode.HASH.modeName()); + distributionName = + Assertions.assertDoesNotThrow(() -> newTable.transformDistribution(Distributions.RANGE)); + Assertions.assertEquals(distributionName, DistributionMode.RANGE.modeName()); } protected static String genRandomName() {