diff --git a/api/src/main/java/com/datastrato/gravitino/rel/Table.java b/api/src/main/java/com/datastrato/gravitino/rel/Table.java index a019ae37ff1..b87edaaa82e 100644 --- a/api/src/main/java/com/datastrato/gravitino/rel/Table.java +++ b/api/src/main/java/com/datastrato/gravitino/rel/Table.java @@ -8,12 +8,12 @@ import com.datastrato.gravitino.Auditable; import com.datastrato.gravitino.Namespace; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; -import com.datastrato.gravitino.rel.expressions.Indexes.Indexes; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.distributions.Distributions; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; +import com.datastrato.gravitino.rel.indexes.Indexes; import java.util.Collections; import java.util.Map; import javax.annotation.Nullable; diff --git a/api/src/main/java/com/datastrato/gravitino/rel/TableCatalog.java b/api/src/main/java/com/datastrato/gravitino/rel/TableCatalog.java index 01cb7167cd9..fdaece66326 100644 --- a/api/src/main/java/com/datastrato/gravitino/rel/TableCatalog.java +++ b/api/src/main/java/com/datastrato/gravitino/rel/TableCatalog.java @@ -27,11 +27,12 @@ import com.datastrato.gravitino.exceptions.NoSuchSchemaException; import com.datastrato.gravitino.exceptions.NoSuchTableException; import com.datastrato.gravitino.exceptions.TableAlreadyExistsException; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.distributions.Distributions; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; +import com.datastrato.gravitino.rel.indexes.Indexes; import java.util.Map; /** @@ -208,7 +209,14 @@ default Table createTable( SortOrder[] sortOrders) throws NoSuchSchemaException, TableAlreadyExistsException { return createTable( - ident, columns, comment, properties, partitions, distribution, sortOrders, new Index[0]); + ident, + columns, + comment, + properties, + partitions, + distribution, + sortOrders, + Indexes.EMPTY_INDEXES); } /** diff --git a/api/src/main/java/com/datastrato/gravitino/rel/expressions/Indexes/Index.java b/api/src/main/java/com/datastrato/gravitino/rel/indexes/Index.java similarity index 91% rename from api/src/main/java/com/datastrato/gravitino/rel/expressions/Indexes/Index.java rename to api/src/main/java/com/datastrato/gravitino/rel/indexes/Index.java index a3cbc1f9bea..3e57a1d7eef 100644 --- a/api/src/main/java/com/datastrato/gravitino/rel/expressions/Indexes/Index.java +++ b/api/src/main/java/com/datastrato/gravitino/rel/indexes/Index.java @@ -3,7 +3,7 @@ * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.rel.expressions.Indexes; +package com.datastrato.gravitino.rel.indexes; /** * The Index interface defines methods for implementing table index columns. Currently, settings for diff --git a/api/src/main/java/com/datastrato/gravitino/rel/expressions/Indexes/Indexes.java b/api/src/main/java/com/datastrato/gravitino/rel/indexes/Indexes.java similarity index 96% rename from api/src/main/java/com/datastrato/gravitino/rel/expressions/Indexes/Indexes.java rename to api/src/main/java/com/datastrato/gravitino/rel/indexes/Indexes.java index 13ba4142ef5..539e5e345cf 100644 --- a/api/src/main/java/com/datastrato/gravitino/rel/expressions/Indexes/Indexes.java +++ b/api/src/main/java/com/datastrato/gravitino/rel/indexes/Indexes.java @@ -2,7 +2,7 @@ * Copyright 2024 Datastrato Pvt Ltd. * This software is licensed under the Apache License version 2. */ -package com.datastrato.gravitino.rel.expressions.Indexes; +package com.datastrato.gravitino.rel.indexes; /** Helper methods to create index to pass into Gravitino. */ public class Indexes { diff --git a/catalogs/catalog-hive/src/main/java/com/datastrato/gravitino/catalog/hive/HiveCatalogOperations.java b/catalogs/catalog-hive/src/main/java/com/datastrato/gravitino/catalog/hive/HiveCatalogOperations.java index 49f965d9a24..d4590ededf4 100644 --- a/catalogs/catalog-hive/src/main/java/com/datastrato/gravitino/catalog/hive/HiveCatalogOperations.java +++ b/catalogs/catalog-hive/src/main/java/com/datastrato/gravitino/catalog/hive/HiveCatalogOperations.java @@ -30,14 +30,14 @@ import com.datastrato.gravitino.rel.Table; import com.datastrato.gravitino.rel.TableCatalog; import com.datastrato.gravitino.rel.TableChange; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; -import com.datastrato.gravitino.rel.expressions.Indexes.Indexes; import com.datastrato.gravitino.rel.expressions.NamedReference; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.distributions.Distributions; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; import com.datastrato.gravitino.rel.expressions.transforms.Transforms; +import com.datastrato.gravitino.rel.indexes.Index; +import com.datastrato.gravitino.rel.indexes.Indexes; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; diff --git a/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/JdbcCatalogOperations.java b/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/JdbcCatalogOperations.java index a82b3e98ee0..b4d8bdfe4f1 100644 --- a/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/JdbcCatalogOperations.java +++ b/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/JdbcCatalogOperations.java @@ -33,12 +33,12 @@ import com.datastrato.gravitino.rel.Table; import com.datastrato.gravitino.rel.TableCatalog; import com.datastrato.gravitino.rel.TableChange; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; -import com.datastrato.gravitino.rel.expressions.Indexes.Indexes; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.distributions.Distributions; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; +import com.datastrato.gravitino.rel.indexes.Indexes; import com.datastrato.gravitino.utils.MapUtils; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; diff --git a/catalogs/catalog-lakehouse-iceberg/src/main/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/IcebergCatalogOperations.java b/catalogs/catalog-lakehouse-iceberg/src/main/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/IcebergCatalogOperations.java index 8b6c24dfe36..875753f1b85 100644 --- a/catalogs/catalog-lakehouse-iceberg/src/main/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/IcebergCatalogOperations.java +++ b/catalogs/catalog-lakehouse-iceberg/src/main/java/com/datastrato/gravitino/catalog/lakehouse/iceberg/IcebergCatalogOperations.java @@ -26,12 +26,12 @@ import com.datastrato.gravitino.rel.Table; import com.datastrato.gravitino.rel.TableCatalog; import com.datastrato.gravitino.rel.TableChange; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; -import com.datastrato.gravitino.rel.expressions.Indexes.Indexes; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.distributions.Distributions; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; +import com.datastrato.gravitino.rel.indexes.Indexes; import com.datastrato.gravitino.utils.MapUtils; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; diff --git a/clients/client-java/src/main/java/com/datastrato/gravitino/client/RelationalCatalog.java b/clients/client-java/src/main/java/com/datastrato/gravitino/client/RelationalCatalog.java index 5de7beba5c5..18538acef90 100644 --- a/clients/client-java/src/main/java/com/datastrato/gravitino/client/RelationalCatalog.java +++ b/clients/client-java/src/main/java/com/datastrato/gravitino/client/RelationalCatalog.java @@ -35,10 +35,10 @@ import com.datastrato.gravitino.rel.Table; import com.datastrato.gravitino.rel.TableCatalog; import com.datastrato.gravitino.rel.TableChange; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import java.util.Arrays; 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 877d1c35f66..5d1178af522 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 @@ -8,10 +8,10 @@ import com.datastrato.gravitino.dto.rel.partitions.Partitioning; import com.datastrato.gravitino.rel.Column; import com.datastrato.gravitino.rel.Table; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import java.util.Map; diff --git a/common/src/main/java/com/datastrato/gravitino/dto/rel/indexes/IndexDTO.java b/common/src/main/java/com/datastrato/gravitino/dto/rel/indexes/IndexDTO.java index 2a06955874a..fd1c4726bb0 100644 --- a/common/src/main/java/com/datastrato/gravitino/dto/rel/indexes/IndexDTO.java +++ b/common/src/main/java/com/datastrato/gravitino/dto/rel/indexes/IndexDTO.java @@ -4,7 +4,7 @@ */ package com.datastrato.gravitino.dto.rel.indexes; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; +import com.datastrato.gravitino.rel.indexes.Index; import com.google.common.base.Preconditions; public class IndexDTO implements Index { 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 194ad13e8f2..9f0b6c8175e 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 @@ -9,7 +9,7 @@ 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.rel.expressions.Indexes.Index; +import com.datastrato.gravitino.rel.indexes.Index; import com.datastrato.gravitino.rest.RESTRequest; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; 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 246c3d3cb6b..40f2b45a5fb 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 @@ -39,7 +39,6 @@ import com.datastrato.gravitino.rel.Table; import com.datastrato.gravitino.rel.expressions.Expression; import com.datastrato.gravitino.rel.expressions.FunctionExpression; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; import com.datastrato.gravitino.rel.expressions.NamedReference; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.distributions.Distributions; @@ -49,6 +48,7 @@ import com.datastrato.gravitino.rel.expressions.sorts.SortOrders; import com.datastrato.gravitino.rel.expressions.transforms.Transform; import com.datastrato.gravitino.rel.expressions.transforms.Transforms; +import com.datastrato.gravitino.rel.indexes.Index; import java.util.Arrays; import org.apache.commons.lang3.ArrayUtils; diff --git a/core/src/main/java/com/datastrato/gravitino/catalog/CatalogOperationDispatcher.java b/core/src/main/java/com/datastrato/gravitino/catalog/CatalogOperationDispatcher.java index 1315fea7447..3c1dff3c771 100644 --- a/core/src/main/java/com/datastrato/gravitino/catalog/CatalogOperationDispatcher.java +++ b/core/src/main/java/com/datastrato/gravitino/catalog/CatalogOperationDispatcher.java @@ -35,11 +35,11 @@ import com.datastrato.gravitino.rel.TableChange; import com.datastrato.gravitino.rel.TableChange.RemoveProperty; import com.datastrato.gravitino.rel.TableChange.SetProperty; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.distributions.Distributions; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; import com.datastrato.gravitino.storage.IdGenerator; import com.datastrato.gravitino.utils.PrincipalUtils; import com.datastrato.gravitino.utils.ThrowableFunction; diff --git a/core/src/main/java/com/datastrato/gravitino/catalog/rel/BaseTable.java b/core/src/main/java/com/datastrato/gravitino/catalog/rel/BaseTable.java index 363384c3df7..f7b11d384da 100644 --- a/core/src/main/java/com/datastrato/gravitino/catalog/rel/BaseTable.java +++ b/core/src/main/java/com/datastrato/gravitino/catalog/rel/BaseTable.java @@ -7,10 +7,10 @@ import com.datastrato.gravitino.meta.AuditInfo; import com.datastrato.gravitino.rel.Column; import com.datastrato.gravitino.rel.Table; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; import java.util.Map; import javax.annotation.Nullable; import lombok.ToString; diff --git a/core/src/main/java/com/datastrato/gravitino/catalog/rel/EntityCombinedTable.java b/core/src/main/java/com/datastrato/gravitino/catalog/rel/EntityCombinedTable.java index 1a167aaed7e..84a705c0c49 100644 --- a/core/src/main/java/com/datastrato/gravitino/catalog/rel/EntityCombinedTable.java +++ b/core/src/main/java/com/datastrato/gravitino/catalog/rel/EntityCombinedTable.java @@ -9,10 +9,10 @@ import com.datastrato.gravitino.meta.TableEntity; import com.datastrato.gravitino.rel.Column; import com.datastrato.gravitino.rel.Table; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; diff --git a/core/src/test/java/com/datastrato/gravitino/TestCatalogOperations.java b/core/src/test/java/com/datastrato/gravitino/TestCatalogOperations.java index 7f78a710694..eaac9ae247e 100644 --- a/core/src/test/java/com/datastrato/gravitino/TestCatalogOperations.java +++ b/core/src/test/java/com/datastrato/gravitino/TestCatalogOperations.java @@ -22,10 +22,10 @@ import com.datastrato.gravitino.rel.Table; import com.datastrato.gravitino.rel.TableCatalog; import com.datastrato.gravitino.rel.TableChange; -import com.datastrato.gravitino.rel.expressions.Indexes.Index; import com.datastrato.gravitino.rel.expressions.distributions.Distribution; import com.datastrato.gravitino.rel.expressions.sorts.SortOrder; import com.datastrato.gravitino.rel.expressions.transforms.Transform; +import com.datastrato.gravitino.rel.indexes.Index; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import java.io.IOException;