From 55b6b978c696d850f18ae8344034bb6040e0d288 Mon Sep 17 00:00:00 2001 From: mchades Date: Wed, 24 Jan 2024 17:08:58 +0800 Subject: [PATCH] [#1675] refactor: rename package name from partitions to partitioning in common module (#1677) ### What changes were proposed in this pull request? rename package name from partitions to partitioning in common module ### Why are the changes needed? Fix: #1675 ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? existing tests --- .../gravitino/rel/indexes/Indexes.java | 6 ++--- .../client/TestRelationalCatalog.java | 8 +++---- .../gravitino/dto/rel/TableDTO.java | 2 +- .../BucketPartitioningDTO.java | 2 +- .../DayPartitioningDTO.java | 2 +- .../FunctionPartitioningDTO.java | 2 +- .../HourPartitioningDTO.java | 2 +- .../IdentityPartitioningDTO.java | 2 +- .../ListPartitioningDTO.java | 2 +- .../MonthPartitioningDTO.java | 2 +- .../Partitioning.java | 2 +- .../RangePartitioningDTO.java | 2 +- .../TruncatePartitioningDTO.java | 2 +- .../YearPartitioningDTO.java | 2 +- .../dto/requests/TableCreateRequest.java | 2 +- .../gravitino/dto/util/DTOConverters.java | 22 +++++++++---------- .../datastrato/gravitino/json/JsonUtils.java | 22 +++++++++---------- .../dto/responses/TestResponses.java | 2 +- .../gravitino/json/TestDTOJsonSerDe.java | 22 +++++++++---------- .../test/catalog/hive/CatalogHiveIT.java | 4 ++-- .../lakehouse/iceberg/CatalogIcebergIT.java | 2 +- .../test/trino/TrinoConnectorIT.java | 6 ++--- .../server/web/rest/TestTableOperations.java | 4 ++-- .../catalog/hive/HiveMetadataAdapter.java | 5 +++-- .../iceberg/IcebergMetadataAdapter.java | 4 ++-- 25 files changed, 67 insertions(+), 66 deletions(-) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/BucketPartitioningDTO.java (96%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/DayPartitioningDTO.java (93%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/FunctionPartitioningDTO.java (96%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/HourPartitioningDTO.java (92%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/IdentityPartitioningDTO.java (93%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/ListPartitioningDTO.java (96%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/MonthPartitioningDTO.java (92%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/Partitioning.java (97%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/RangePartitioningDTO.java (96%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/TruncatePartitioningDTO.java (96%) rename common/src/main/java/com/datastrato/gravitino/dto/rel/{partitions => partitioning}/YearPartitioningDTO.java (92%) diff --git a/api/src/main/java/com/datastrato/gravitino/rel/indexes/Indexes.java b/api/src/main/java/com/datastrato/gravitino/rel/indexes/Indexes.java index 830ae72a34b..8e7d5a1395c 100644 --- a/api/src/main/java/com/datastrato/gravitino/rel/indexes/Indexes.java +++ b/api/src/main/java/com/datastrato/gravitino/rel/indexes/Indexes.java @@ -14,7 +14,7 @@ public class Indexes { * * @param name The name of the index * @param fieldNames The field names under the table contained in the index. - * @return + * @return The unique index */ public static Index unique(String name, String[][] fieldNames) { return of(Index.IndexType.UNIQUE_KEY, name, fieldNames); @@ -25,7 +25,7 @@ public static Index unique(String name, String[][] fieldNames) { * * @param name The name of the index * @param fieldNames The field names under the table contained in the index. - * @return + * @return The primary index */ public static Index primary(String name, String[][] fieldNames) { return of(Index.IndexType.PRIMARY_KEY, name, fieldNames); @@ -35,7 +35,7 @@ public static Index primary(String name, String[][] fieldNames) { * @param indexType The type of the index * @param name The name of the index * @param fieldNames The field names under the table contained in the index. - * @return + * @return The index */ public static Index of(Index.IndexType indexType, String name, String[][] fieldNames) { return IndexImpl.builder() diff --git a/clients/client-java/src/test/java/com/datastrato/gravitino/client/TestRelationalCatalog.java b/clients/client-java/src/test/java/com/datastrato/gravitino/client/TestRelationalCatalog.java index 13e538a4bd5..782e310ce8f 100644 --- a/clients/client-java/src/test/java/com/datastrato/gravitino/client/TestRelationalCatalog.java +++ b/clients/client-java/src/test/java/com/datastrato/gravitino/client/TestRelationalCatalog.java @@ -4,7 +4,7 @@ */ package com.datastrato.gravitino.client; -import static com.datastrato.gravitino.dto.rel.partitions.Partitioning.EMPTY_PARTITIONING; +import static com.datastrato.gravitino.dto.rel.partitioning.Partitioning.EMPTY_PARTITIONING; import static com.datastrato.gravitino.rel.expressions.sorts.SortDirection.DESCENDING; import static org.apache.hc.core5.http.HttpStatus.SC_BAD_REQUEST; import static org.apache.hc.core5.http.HttpStatus.SC_CONFLICT; @@ -26,9 +26,9 @@ import com.datastrato.gravitino.dto.rel.expressions.FieldReferenceDTO; import com.datastrato.gravitino.dto.rel.expressions.FunctionArg; import com.datastrato.gravitino.dto.rel.expressions.LiteralDTO; -import com.datastrato.gravitino.dto.rel.partitions.DayPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.IdentityPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.DayPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.IdentityPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.dto.requests.CatalogCreateRequest; import com.datastrato.gravitino.dto.requests.SchemaCreateRequest; import com.datastrato.gravitino.dto.requests.SchemaUpdateRequest; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java index 5d1178af522..f2e5f3cbf6d 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java @@ -5,7 +5,7 @@ package com.datastrato.gravitino.dto.rel; import com.datastrato.gravitino.dto.AuditDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.rel.Column; import com.datastrato.gravitino.rel.Table; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/BucketPartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/BucketPartitioningDTO.java similarity index 96% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/BucketPartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/BucketPartitioningDTO.java index 2c2cb97a398..5da9eaa2ee2 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/BucketPartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/BucketPartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import static com.datastrato.gravitino.dto.rel.PartitionUtils.validateFieldExistence; import static com.datastrato.gravitino.rel.expressions.transforms.Transforms.bucket; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/DayPartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/DayPartitioningDTO.java similarity index 93% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/DayPartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/DayPartitioningDTO.java index c9ed432ab75..a2713757343 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/DayPartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/DayPartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import com.google.common.base.Preconditions; import lombok.EqualsAndHashCode; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/FunctionPartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/FunctionPartitioningDTO.java similarity index 96% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/FunctionPartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/FunctionPartitioningDTO.java index da8f2663ed1..f932ce119ac 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/FunctionPartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/FunctionPartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import static com.datastrato.gravitino.dto.rel.PartitionUtils.validateFieldExistence; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/HourPartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/HourPartitioningDTO.java similarity index 92% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/HourPartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/HourPartitioningDTO.java index b95fe926892..ab5385885de 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/HourPartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/HourPartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import com.google.common.base.Preconditions; import org.apache.commons.lang3.ArrayUtils; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/IdentityPartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/IdentityPartitioningDTO.java similarity index 93% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/IdentityPartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/IdentityPartitioningDTO.java index a8faf2997b8..00c1278a2e1 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/IdentityPartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/IdentityPartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import com.google.common.base.Preconditions; import lombok.EqualsAndHashCode; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/ListPartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/ListPartitioningDTO.java similarity index 96% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/ListPartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/ListPartitioningDTO.java index 54756458fd9..484253c74ff 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/ListPartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/ListPartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import static com.datastrato.gravitino.dto.rel.PartitionUtils.validateFieldExistence; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/MonthPartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/MonthPartitioningDTO.java similarity index 92% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/MonthPartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/MonthPartitioningDTO.java index b5a68bf3390..309380493ef 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/MonthPartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/MonthPartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import com.google.common.base.Preconditions; import org.apache.commons.lang3.ArrayUtils; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/Partitioning.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/Partitioning.java similarity index 97% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/Partitioning.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/Partitioning.java index 0b048529e25..660a1c9f362 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/Partitioning.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/Partitioning.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import static com.datastrato.gravitino.dto.rel.PartitionUtils.validateFieldExistence; import static com.datastrato.gravitino.rel.expressions.NamedReference.field; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/RangePartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/RangePartitioningDTO.java similarity index 96% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/RangePartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/RangePartitioningDTO.java index 909f3ad62fe..b71df1b6a2b 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/RangePartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/RangePartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import static com.datastrato.gravitino.dto.rel.PartitionUtils.validateFieldExistence; import static com.datastrato.gravitino.rel.expressions.NamedReference.field; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/TruncatePartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/TruncatePartitioningDTO.java similarity index 96% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/TruncatePartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/TruncatePartitioningDTO.java index 2353c631051..2c710d0fa46 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/TruncatePartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/TruncatePartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import static com.datastrato.gravitino.dto.rel.PartitionUtils.validateFieldExistence; import static com.datastrato.gravitino.rel.expressions.transforms.Transforms.truncate; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/YearPartitioningDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/YearPartitioningDTO.java similarity index 92% rename from common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/YearPartitioningDTO.java rename to common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/YearPartitioningDTO.java index 73c493b4ba6..687ff3e98d6 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/partitions/YearPartitioningDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/partitioning/YearPartitioningDTO.java @@ -2,7 +2,7 @@ * Copyright 2023 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.dto.rel.partitions; +package com.datastrato.gravitino.dto.rel.partitioning; import com.google.common.base.Preconditions; import org.apache.commons.lang3.ArrayUtils; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/requests/TableCreateRequest.java b/common/src/main/java/com/datastrato/gravitino/dto/requests/TableCreateRequest.java index c81d444ff3d..2e0571ac5f4 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/requests/TableCreateRequest.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/requests/TableCreateRequest.java @@ -8,7 +8,7 @@ import com.datastrato.gravitino.dto.rel.DistributionDTO; import com.datastrato.gravitino.dto.rel.SortOrderDTO; import com.datastrato.gravitino.dto.rel.expressions.FunctionArg; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.rel.indexes.Index; import com.datastrato.gravitino.rest.RESTRequest; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/util/DTOConverters.java b/common/src/main/java/com/datastrato/gravitino/dto/util/DTOConverters.java index b03cf3f3353..13f5fa3e06e 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/util/DTOConverters.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/util/DTOConverters.java @@ -23,17 +23,17 @@ import com.datastrato.gravitino.dto.rel.expressions.FunctionArg; import com.datastrato.gravitino.dto.rel.expressions.LiteralDTO; import com.datastrato.gravitino.dto.rel.indexes.IndexDTO; -import com.datastrato.gravitino.dto.rel.partitions.BucketPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.DayPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.FunctionPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.HourPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.IdentityPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.ListPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.MonthPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; -import com.datastrato.gravitino.dto.rel.partitions.RangePartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.TruncatePartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.YearPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.BucketPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.DayPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.FunctionPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.HourPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.IdentityPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.ListPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.MonthPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.RangePartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.TruncatePartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.YearPartitioningDTO; import com.datastrato.gravitino.rel.Column; import com.datastrato.gravitino.rel.Schema; import com.datastrato.gravitino.rel.Table; diff --git a/common/src/main/java/com/datastrato/gravitino/json/JsonUtils.java b/common/src/main/java/com/datastrato/gravitino/json/JsonUtils.java index 73e1bd06db2..b4afc2dd6ec 100644 --- a/common/src/main/java/com/datastrato/gravitino/json/JsonUtils.java +++ b/common/src/main/java/com/datastrato/gravitino/json/JsonUtils.java @@ -12,17 +12,17 @@ import com.datastrato.gravitino.dto.rel.expressions.FuncExpressionDTO; import com.datastrato.gravitino.dto.rel.expressions.FunctionArg; import com.datastrato.gravitino.dto.rel.expressions.LiteralDTO; -import com.datastrato.gravitino.dto.rel.partitions.BucketPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.DayPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.FunctionPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.HourPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.IdentityPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.ListPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.MonthPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; -import com.datastrato.gravitino.dto.rel.partitions.RangePartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.TruncatePartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.YearPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.BucketPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.DayPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.FunctionPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.HourPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.IdentityPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.ListPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.MonthPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.RangePartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.TruncatePartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.YearPartitioningDTO; import com.datastrato.gravitino.rel.Column; import com.datastrato.gravitino.rel.TableChange; import com.datastrato.gravitino.rel.expressions.Expression; diff --git a/common/src/test/java/com/datastrato/gravitino/dto/responses/TestResponses.java b/common/src/test/java/com/datastrato/gravitino/dto/responses/TestResponses.java index a9036cab6ce..49fdf77ab0b 100644 --- a/common/src/test/java/com/datastrato/gravitino/dto/responses/TestResponses.java +++ b/common/src/test/java/com/datastrato/gravitino/dto/responses/TestResponses.java @@ -17,7 +17,7 @@ import com.datastrato.gravitino.dto.rel.ColumnDTO; import com.datastrato.gravitino.dto.rel.SchemaDTO; import com.datastrato.gravitino.dto.rel.TableDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.rel.types.Types; import java.time.Instant; import org.junit.jupiter.api.Test; diff --git a/common/src/test/java/com/datastrato/gravitino/json/TestDTOJsonSerDe.java b/common/src/test/java/com/datastrato/gravitino/json/TestDTOJsonSerDe.java index c9fc4acd5be..4dd851e7e1b 100644 --- a/common/src/test/java/com/datastrato/gravitino/json/TestDTOJsonSerDe.java +++ b/common/src/test/java/com/datastrato/gravitino/json/TestDTOJsonSerDe.java @@ -14,17 +14,17 @@ import com.datastrato.gravitino.dto.rel.expressions.FuncExpressionDTO; import com.datastrato.gravitino.dto.rel.expressions.FunctionArg; import com.datastrato.gravitino.dto.rel.expressions.LiteralDTO; -import com.datastrato.gravitino.dto.rel.partitions.BucketPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.DayPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.FunctionPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.HourPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.IdentityPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.ListPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.MonthPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; -import com.datastrato.gravitino.dto.rel.partitions.RangePartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.TruncatePartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.YearPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.BucketPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.DayPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.FunctionPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.HourPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.IdentityPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.ListPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.MonthPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.RangePartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.TruncatePartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.YearPartitioningDTO; import com.datastrato.gravitino.rel.Column; import com.datastrato.gravitino.rel.types.Type; import com.datastrato.gravitino.rel.types.Types; diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/hive/CatalogHiveIT.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/hive/CatalogHiveIT.java index 7d4d29cfed0..6e85d387c1a 100644 --- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/hive/CatalogHiveIT.java +++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/hive/CatalogHiveIT.java @@ -39,8 +39,8 @@ import com.datastrato.gravitino.client.GravitinoMetaLake; import com.datastrato.gravitino.dto.rel.ColumnDTO; import com.datastrato.gravitino.dto.rel.expressions.FieldReferenceDTO; -import com.datastrato.gravitino.dto.rel.partitions.IdentityPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.IdentityPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.exceptions.NoSuchCatalogException; import com.datastrato.gravitino.exceptions.NoSuchMetalakeException; import com.datastrato.gravitino.exceptions.NoSuchSchemaException; diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/CatalogIcebergIT.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/CatalogIcebergIT.java index a922af30260..6ae8f403bb7 100644 --- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/CatalogIcebergIT.java +++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/catalog/lakehouse/iceberg/CatalogIcebergIT.java @@ -17,7 +17,7 @@ import com.datastrato.gravitino.catalog.lakehouse.iceberg.ops.IcebergTableOpsHelper; import com.datastrato.gravitino.client.GravitinoMetaLake; import com.datastrato.gravitino.dto.rel.ColumnDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.exceptions.NoSuchSchemaException; import com.datastrato.gravitino.exceptions.SchemaAlreadyExistsException; import com.datastrato.gravitino.exceptions.TableAlreadyExistsException; diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/trino/TrinoConnectorIT.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/trino/TrinoConnectorIT.java index 25d84a9b36e..fe8aad0310a 100644 --- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/trino/TrinoConnectorIT.java +++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/trino/TrinoConnectorIT.java @@ -14,8 +14,8 @@ import com.datastrato.gravitino.dto.rel.DistributionDTO; import com.datastrato.gravitino.dto.rel.SortOrderDTO; import com.datastrato.gravitino.dto.rel.expressions.FieldReferenceDTO; -import com.datastrato.gravitino.dto.rel.partitions.IdentityPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning.SingleFieldPartitioning; +import com.datastrato.gravitino.dto.rel.partitioning.IdentityPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.integration.test.catalog.jdbc.utils.JdbcDriverDownloader; import com.datastrato.gravitino.integration.test.container.ContainerSuite; import com.datastrato.gravitino.integration.test.container.HiveContainer; @@ -947,7 +947,7 @@ void testIcebergTableAndSchemaCreatedByGravitino() throws InterruptedException { NameIdentifier.of(metalakeName, catalogName, schemaName, tableCreatedByTrino)); Arrays.stream(table.partitioning()) - .anyMatch(p -> ((SingleFieldPartitioning) p).fieldName()[0].equals("name")); + .anyMatch(p -> ((Partitioning.SingleFieldPartitioning) p).fieldName()[0].equals("name")); Arrays.stream(table.sortOrder()) .anyMatch(p -> ((FieldReferenceDTO) p.expression()).fieldName()[0].equals("id")); } diff --git a/server/src/test/java/com/datastrato/gravitino/server/web/rest/TestTableOperations.java b/server/src/test/java/com/datastrato/gravitino/server/web/rest/TestTableOperations.java index 15fcfd20698..cf1faeca439 100644 --- a/server/src/test/java/com/datastrato/gravitino/server/web/rest/TestTableOperations.java +++ b/server/src/test/java/com/datastrato/gravitino/server/web/rest/TestTableOperations.java @@ -18,8 +18,8 @@ import com.datastrato.gravitino.dto.rel.SortOrderDTO; import com.datastrato.gravitino.dto.rel.TableDTO; import com.datastrato.gravitino.dto.rel.expressions.FieldReferenceDTO; -import com.datastrato.gravitino.dto.rel.partitions.IdentityPartitioningDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning; +import com.datastrato.gravitino.dto.rel.partitioning.IdentityPartitioningDTO; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.dto.requests.TableCreateRequest; import com.datastrato.gravitino.dto.requests.TableUpdateRequest; import com.datastrato.gravitino.dto.requests.TableUpdatesRequest; diff --git a/trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java b/trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java index ac60fa8850d..98c60c66f52 100644 --- a/trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java +++ b/trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java @@ -12,7 +12,7 @@ import com.datastrato.catalog.property.PropertyConverter; import com.datastrato.gravitino.dto.rel.DistributionDTO; import com.datastrato.gravitino.dto.rel.expressions.FieldReferenceDTO; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning.SingleFieldPartitioning; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.rel.expressions.Expression; import com.datastrato.gravitino.rel.expressions.NamedReference; import com.datastrato.gravitino.rel.expressions.distributions.Distributions; @@ -186,7 +186,8 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) { ? Arrays.stream(gravitinoTable.getPartitioning()) .map( ts -> - ((SingleFieldPartitioning) ts).fieldName()[0].toLowerCase(Locale.ENGLISH)) + ((Partitioning.SingleFieldPartitioning) ts) + .fieldName()[0].toLowerCase(Locale.ENGLISH)) .collect(Collectors.toList()) : Collections.EMPTY_LIST); } diff --git a/trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergMetadataAdapter.java b/trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergMetadataAdapter.java index 23a4ff42fbf..169cc75ec50 100644 --- a/trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergMetadataAdapter.java +++ b/trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergMetadataAdapter.java @@ -8,7 +8,7 @@ import static com.datastrato.gravitino.trino.connector.catalog.iceberg.IcebergPropertyMeta.ICEBERG_SORTED_BY_PROPERTY; import com.datastrato.catalog.property.PropertyConverter; -import com.datastrato.gravitino.dto.rel.partitions.Partitioning.SingleFieldPartitioning; +import com.datastrato.gravitino.dto.rel.partitioning.Partitioning; import com.datastrato.gravitino.rel.expressions.Expression; import com.datastrato.gravitino.rel.expressions.NamedReference; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; @@ -150,7 +150,7 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) { ICEBERG_PARTITIONING_PROPERTY, gravitinoTable.getPartitioning().length > 0 ? Arrays.stream(gravitinoTable.getPartitioning()) - .map(ts -> ((SingleFieldPartitioning) ts).fieldName()[0]) + .map(ts -> ((Partitioning.SingleFieldPartitioning) ts).fieldName()[0]) .collect(Collectors.toList()) : Collections.EMPTY_LIST); }