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 9, 2024
1 parent 9614ffd commit 7b0f1cf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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;
Expand Down Expand Up @@ -83,7 +84,8 @@ public Table createTable(
Map<String, String> properties,
Transform[] partitions,
Distribution distribution,
SortOrder[] sortOrders)
SortOrder[] sortOrders,
Index[] indexes)
throws NoSuchSchemaException, TableAlreadyExistsException {
AuditInfo auditInfo =
new AuditInfo.Builder().withCreator("test").withCreateTime(Instant.now()).build();
Expand All @@ -98,6 +100,7 @@ public Table createTable(
.withDistribution(distribution)
.withSortOrders(sortOrders)
.withPartitioning(partitions)
.withIndexes(indexes)
.build();

if (tables.containsKey(ident)) {
Expand All @@ -115,6 +118,7 @@ public Table createTable(
.withDistribution(distribution)
.withSortOrders(sortOrders)
.withPartitioning(partitions)
.withIndexes(indexes)
.build();
}

Expand Down

0 comments on commit 7b0f1cf

Please sign in to comment.