yuqi1129 commented on code in PR #9463:
URL: https://github.com/apache/gravitino/pull/9463#discussion_r2609644882
##########
catalogs/catalog-lakehouse-generic/src/main/java/org/apache/gravitino/catalog/lakehouse/lance/LanceTableOperations.java:
##########
@@ -259,8 +260,15 @@ Table createTableInternal(
throws NoSuchSchemaException, TableAlreadyExistsException {
if (register) {
+ // If this is a register operation, it should be a external table.
+ Map<String, String> stringStringMap = Maps.newHashMap(properties);
+ if (!properties.containsKey(Table.PROPERTY_EXTERNAL)
+ || !Boolean.parseBoolean(properties.get(Table.PROPERTY_EXTERNAL))) {
+ stringStringMap.put(Table.PROPERTY_EXTERNAL, "true");
+ }
Review Comment:
> What is the exception?
The following code will execute
```java
Dataset.drop(location,
LancePropertiesUtils.getLanceStorageOptions(table.properties()));
```
And the exception will be like
```text
Caused by: java.io.IOException: Not found: data/sales/orders,
/Users/runner/work/lance/lance/rust/lance-io/src/local.rs:45:23
at com.lancedb.lance.Dataset.drop(Native Method)
~[lance-core-0.39.0.jar:?]
at
org.apache.gravitino.catalog.lakehouse.lance.LanceTableOperations.dropTable(LanceTableOperations.java:234)
~[?:?]
... 89 more
```
> You should not add the assumption if the Lance spec doesn't have such a
restriction. If you want to add this restriction, can you show me the Lance
register definition?
There are no docs regarding properties `external`, it only says that
registering table is `Register an existing table at a given storage location as
id.
More, please refer to
https://editor.swagger.io/?url=https://raw.githubusercontent.com/lance-format/lance-namespace/refs/heads/main/docs/src/rest.yaml
--
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]