You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "yuqi1129 (via GitHub)" <gi...@apache.org> on 2026/01/13 13:15:08 UTC

[I] [Improvement] Read the latest scheme for an external Lance table via the location when loading it [gravitino]

yuqi1129 opened a new issue, #9706:
URL: https://github.com/apache/gravitino/issues/9706

   ### What would you like to be improved?
   
   Currently, the Lance table in Lakehouse generic support properties `external`, that is 
   - `true` means the location is not fully managed by the Gravitino server, and Users can access the location directly without using Gravitino API
   - `false` means that the location is only managed and accessible by the Gravitino server.
   
   For a lance table with `external = true`, we need to access the location to get the latest metadata when trying to load the table.
   
   ### How should we improve?
   
   _No response_


-- 
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: commits-unsubscribe@gravitino.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Read the latest scheme for an external Lance table via the location when loading it [gravitino]

Posted by "freesinger (via GitHub)" <gi...@apache.org>.
freesinger commented on issue #9706:
URL: https://github.com/apache/gravitino/issues/9706#issuecomment-4280769300

   Hi @yuqi1129 , is there any update on this issue? I’ve recently run into a similar situation — reading the actual schema from storage is accurate but can be quite inefficient — so I’m also very interested in having a configurable option here.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Read the latest scheme for an external Lance table via the location when loading it [gravitino]

Posted by "freesinger (via GitHub)" <gi...@apache.org>.
freesinger commented on issue #9706:
URL: https://github.com/apache/gravitino/issues/9706#issuecomment-4286455567

   @yuqi1129 
   I think it's sweet to provide configurable way to determine how to update Lance schema.
   
   Short note and comparison table on schema refresh for Lance external tables in Gravitino.
   
   | Aspect                 | Current Gravitino                                            | "Real-time" in Lance (interpretation)                        | Option A: Request-level flag                                 | Option B: Service-level config                               | Trade-offs                                                   |
   | :--------------------- | :----------------------------------------------------------- | :----------------------------------------------------------- | :----------------------------------------------------------- | :----------------------------------------------------------- | :----------------------------------------------------------- |
   | **Schema Source**      | Reads from Gravitino's entity store, not the physical dataset. | The Lance format supports retrieving the latest schema by opening the dataset. | A request flag (e.g., `refresh=true`) would trigger a direct read from storage. | A catalog/service-level config would set the default refresh behavior for all reads. | Performance vs. consistency: catalog cache is fast but can be stale; storage reads are accurate but slow. |
   | **Version Sync**       | `LANCE_TABLE_VERSION` property is persisted by some write operations but not by `describe`. | REST spec's `load_detailed_metadata=true` implies fetching the latest version from storage. | The request could optionally commit the refreshed schema and version back to the entity store. | Configuration could enforce that all reads on external tables refresh and commit the schema. | Request-level gives flexibility; service-level ensures consistency but may have wide performance impact. |
   | **API Design**         | No explicit parameter exists on `describeTable` to force a storage read. | The Lance REST spec provides a `load_detailed_metadata` flag for this purpose. | A new parameter like `x-gravitino-refresh-schema=true` could be added to the REST API. | The behavior would be implicit, controlled entirely by backend configuration without API changes. | API flags are explicit but add complexity; config is simpler for clients but less flexible. |
   | **Recommended Policy** | N/A                                                          | N/A                                                          | A request parameter could select one of three modes for schema resolution. | A service property would set the default policy for all external tables. | A flexible policy balances performance, consistency, and operational needs for different use cases. |
   | **3-Mode Policy**      | `strict-catalog`: Always reads from the entity store (current default). | `refresh-read`: Reads from storage for the current request only, without persisting. | `refresh-and-commit`: Reads from storage and updates the entity store with the new schema. | These modes could be set as the default behavior at the service or catalog level. | `strict-catalog` is fast; `refresh-read` is good for ad-hoc checks; `refresh-and-commit` ensures long-term consistency. |


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Read the latest scheme for an external Lance table via the location when loading it [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on issue #9706:
URL: https://github.com/apache/gravitino/issues/9706#issuecomment-4286787286

   One thing we may need to note is that, currently, the Gravitino Lance REST service supports both `createTable`, `registerTable`, and `createEmptyTable`(deprecated in the later version).  Only tables created by `createTable` can fetch the latest metadata and schema, whereas tables created by `registerTable` lack the necessary information, like S3 AKSK to handle it. 
   
   This problem affects `Schema Source` and `Version Sync`.  For tables that are only created or modified by Gravitino, it seems unnecessary to handle this problem. For tables that can be changed without Gravitino, Gravitino may lack information to update metadata, so we hesitate about it for a long time.  How to handle synchronization problems for those tables only registered in Gravitino. 
   
   > Configuration could enforce that all reads on external tables refresh and commit the schema.
   
   How can we guarantee that all changes without the Gravitino server can update versions in Gravitino?
   
   
   
   
   
   
   
   


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Read the latest scheme for an external Lance table via the location when loading it [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on issue #9706:
URL: https://github.com/apache/gravitino/issues/9706#issuecomment-4280835302

   @freesinger 
   We haven't any progress so far due to https://github.com/apache/gravitino/pull/9659#discussion_r2684309785, would you like to share you thoughts here.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Read the latest scheme for an external Lance table via the location when loading it [gravitino]

Posted by "freesinger (via GitHub)" <gi...@apache.org>.
freesinger commented on issue #9706:
URL: https://github.com/apache/gravitino/issues/9706#issuecomment-4287082852

   I think there are actually two different categories of external Lance tables here:
   
   - Tables that are **created and evolved only via Gravitino** (createTable plus alter): the catalog already knows the location and has a stable way to access storage, so implementing refresh-read / refresh-and-commit is relatively straightforward.
   - Tables that are **only registered** via registerTable (or createEmptyTable in older versions): Gravitino only knows the location but may not have any credentials or storage options to open the dataset, so we cannot safely assume we can always fetch the “real” schema from storage.
   
   For my own opinion, instead of trying to guarantee that “all out-of-band changes are always reflected in Gravitino”, it might be more realistic to:
   
   1. Introduce a **pluggable credential / storage-options provider** for the Lance REST and generic lakehouse Lance catalog. Given a table location (and catalog config), this provider returns the storage_options needed to open the dataset (e.g. via env-based credentials, cloud roles, STS tokens or any deployment-specific mechanism). If the provider cannot resolve credentials, we fall back to strict-catalog.
    
   2. Explicitly mark which external tables are **refreshable**. For example, only tables that either:
     - are created by Gravitino itself with proper storage configuration, or
     - are registered with additional properties that the credential provider can use,
   can opt into refresh-read / refresh-and-commit. Other tables remain in strict-catalog mode and are documented as “not refreshable”.
    
   3. Treat schema sync for out-of-band changes as **best-effort lazy reconciliation** rather than a strong guarantee. Users can either:
   - request a refresh on read (e.g. via a request-level flag and refresh-and-commit), or
   - run an offline reconciliation job that scans external tables and updates versions in Gravitino.
   
   With this approach, a configuration like “refresh-and-commit for all external tables” would really mean “for all external tables that are explicitly marked as refreshable and for which the credential provider can open the dataset”, otherwise we stay in the current strict-catalog behavior.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org