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


##########
lance/lance-common/src/main/java/org/apache/gravitino/lance/common/ops/gravitino/GravitinoLanceTableOperations.java:
##########
@@ -266,6 +279,78 @@ public DeregisterTableResponse deregisterTable(String 
tableId, String delimiter)
     return response;
   }
 
+  // Note: Create indices is an asynchronous operation in Lance Lakehouse.
+  @Override
+  public CreateTableIndexResponse createTableIndex(
+      String tableId, String delimiter, CreateTableIndexRequest request) {
+    ObjectIdentifier nsId = ObjectIdentifier.of(tableId, 
Pattern.quote(delimiter));
+    Preconditions.checkArgument(
+        nsId.levels() == 3, "Expected at 3-level namespace but got: %s", 
nsId.levels());
+
+    String catalogName = nsId.levelAtListPos(0);
+    Catalog catalog = 
namespaceWrapper.loadAndValidateLakehouseCatalog(catalogName);
+
+    NameIdentifier tableIdentifier =
+        NameIdentifier.of(nsId.levelAtListPos(1), nsId.levelAtListPos(2));
+
+    // There seem to be missing index name in the request, using 
Optional.empty() for now.
+    TableChange tableChange = buildAddIndex(Optional.empty(), request);

Review Comment:
   The value of the index name can be null(empty) for Lance table, and Lance 
will automatically generate the name.



-- 
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