From 86a3aea3229966f590f80f416efe991a82e14bbc Mon Sep 17 00:00:00 2001 From: Clearvive Date: Mon, 22 Jan 2024 16:05:26 +0800 Subject: [PATCH] [#1339] feat(table): Add index for tables. --- .../datastrato/gravitino/rel/indexes/Indexes.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 dd25d235339..084097d27d9 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 @@ -9,10 +9,22 @@ public class Indexes { public static final Index[] EMPTY_INDEXES = new Index[0]; + /** + * Create a unique index on columns. Like unique (a) or unique (a, b), for complex like unique + * @param name The name of the index + * @param fieldNames The field names under the table contained in the index. + * @return + */ public static Index unique(String name, String[][] fieldNames) { return of(Index.IndexType.UNIQUE_KEY, name, fieldNames); } + /** + * Create a primary index on columns. Like primary (a), for complex like primary + * @param name The name of the index + * @param fieldNames The field names under the table contained in the index. + * @return + */ public static Index primary(String name, String[][] fieldNames) { return of(Index.IndexType.PRIMARY_KEY, name, fieldNames); }