youngyjd commented on code in PR #9659:
URL: https://github.com/apache/gravitino/pull/9659#discussion_r2684971015


##########
catalogs/catalog-lakehouse-generic/src/main/java/org/apache/gravitino/catalog/lakehouse/lance/LanceTableOperations.java:
##########
@@ -259,7 +262,29 @@ Table createTableInternal(
       String location)
       throws NoSuchSchemaException, TableAlreadyExistsException {
 
+    Map<String, String> storageProps = 
LancePropertiesUtils.getLanceStorageOptions(properties);
     if (register) {
+      // Try to check if the Lance dataset exists at the location and then 
extract the schema.
+      // Note: We will ignore the column parameter in this case.
+      LOG.warn(
+          "Registering existing Lance table at location {}. The provided 
schema will be ignored. columns: {}",
+          location,
+          Arrays.toString(columns));
+
+      try (Dataset readDataset =
+          Dataset.open(
+              location, new 
ReadOptions.Builder().setStorageOptions(storageProps).build())) {

Review Comment:
   > Do you mean that the server does not have permission to access the 
dataset? And all you want is to record the location of a specific table? If so, 
we indeed can add a switch to control the behaviour here.
   
   First phase, we only record location of the table only. Second phase, we 
likely will configure the server to have the read permission of the actual 
data. Adding a switch to control the behavior is awesome!



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