Skip to content

Commit

Permalink
[apache#1339] feat(table): Add index for tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Clearvive authored and Clearvive committed Jan 19, 2024
1 parent 41ad22f commit 900fb53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
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;
Expand Down Expand Up @@ -360,7 +361,7 @@ public Table createTable(
Index[] indexes)
throws NoSuchSchemaException, TableAlreadyExistsException {
Preconditions.checkArgument(
null == indexes || indexes.length == 0, "jdbc-catalog does not support indexes");
indexes == Indexes.EMPTY_INDEXES, "jdbc-catalog does not support indexes");
Preconditions.checkArgument(
null == distribution || distribution == Distributions.NONE,
"jdbc-catalog does not support distribution");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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;
Expand Down Expand Up @@ -486,7 +487,7 @@ public Table createTable(
Index[] indexes)
throws NoSuchSchemaException, TableAlreadyExistsException {
Preconditions.checkArgument(
null == indexes || indexes.length == 0, "iceberg-catalog does not support indexes");
indexes == Indexes.EMPTY_INDEXES, "iceberg-catalog does not support indexes");
try {
if (!Distributions.NONE.equals(distribution)) {
throw new UnsupportedOperationException("Iceberg does not support distribution");
Expand Down

0 comments on commit 900fb53

Please sign in to comment.