yuqi1129 commented on code in PR #9927:
URL: https://github.com/apache/gravitino/pull/9927#discussion_r2787501788


##########
api/src/main/java/org/apache/gravitino/rel/indexes/Indexes.java:
##########
@@ -38,44 +40,62 @@ public class Indexes {
    *
    * @param name The name of the index
    * @param fieldNames The field names under the table contained in the index.
+   * @param properties Extra properties for index configuration
    * @return The unique index
    */
-  public static Index unique(String name, String[][] fieldNames) {
-    return of(Index.IndexType.UNIQUE_KEY, name, fieldNames);
+  public static Index unique(String name, String[][] fieldNames, Map<String, 
String> properties) {

Review Comment:
   I think it's better to keep the method here and add a new one, in this way, 
there is no need to change so many tests.
   
   ```java
   public static Index unique(String name, String[][] fieldNames) {
       return unique(Index.IndexType.UNIQUE_KEY, name, fieldNames, 
ImmutableMap.of());
   }
   
   public static Index unique(String name, String[][] fieldNames, Map<String, 
String> properties ) {
       return of(Index.IndexType.UNIQUE_KEY, name, fieldNames, properties);
   }
   
   
   
   
   ```



##########
api/src/main/java/org/apache/gravitino/rel/indexes/Index.java:
##########
@@ -44,6 +45,11 @@ public interface Index {
    */
   String[][] fieldNames();
 
+  /**
+   * @return Extra properties for index configuration
+   */
+  Map<String, String> properties();

Review Comment:
   I would suggest you use the default implementation like 
   ```java
   
   default Map<String, String> properties() {
       return Immutable.of();
   }
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to