FANNG1 opened a new issue, #11178:
URL: https://github.com/apache/gravitino/issues/11178
### Version
main branch
### Describe what's wrong
In the Lance REST namespace, `DescribeTableResponse.is_only_declared` is
populated by reading the `lance.declared` table property:
```java
// GravitinoLanceTableOperations.describeTable()
if (checkDeclared) {
response.setIsOnlyDeclared(
Boolean.parseBoolean(table.properties().getOrDefault(LANCE_TABLE_DECLARED,
"false")));
}
```
The `lance.declared` property is written exactly once inside
`declareTable()`, and is registered as **immutable** in `LanceTableDelegator`,
so it can never change afterwards.
Per the Lance namespace spec (v0.7.0), `is_only_declared` is a **current
state** — "the table is only declared in the namespace and has no underlying
storage data yet" — and is expected to flip to `false` once the table is
materialized by the first data write.
Because Gravitino derives it from an immutable property, a table that was
declared via `declareTable` and then populated with real data will
**permanently report `is_only_declared=true`**, which is incorrect.
### Error message and/or stacktrace
N/A — semantic bug, no exception is thrown.
### How to reproduce
1. Declare a table via the Lance REST `declare` endpoint
(`lance.declared=true`).
2. Write actual data into the table's location (e.g. via lance-ray).
3. Call `describeTable` with `check_declared=true`.
4. Observe `is_only_declared=true` even though the table now has storage
data.
### Additional context
Discovered while reviewing #11060. This issue is related to #11176 (which
refreshes the table column schema from the Lance dataset on `loadTable`), but
addresses a different aspect: the `is_only_declared` field in the
`describeTable` REST response, derived from the immutable `lance.declared`
property. The two are related but distinct concerns and may not necessarily be
addressed in the same PR. A correct fix likely requires `describeTable` (when
`check_declared=true`) to probe the table location for an actual Lance manifest
instead of reading the static property.
--
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]