zhoulii opened a new issue, #11135:
URL: https://github.com/apache/paimon/issues/11135

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   
   ### Paimon version
   
   master
   
   ### Compute Engine
   
   PyPaimon Python API
   
   ### Minimal reproduce step
   
   1. Create a normal filesystem Paimon table under a path such as 
`warehouse/default/external`.
   2. Register that table in a REST catalog with 
`GetTableResponse.isExternal=true`.
   3. Load the table through PyPaimon:
   
      ```python
      catalog = RESTCatalog(...)
      table = catalog.get_table("default.external")
      ```
   
   4. Read or write the table. PyPaimon uses `external_file_io` for the table 
data, but it still places a `RESTCatalogLoader` in `CatalogEnvironment`.
   
   Because the external table still has a REST catalog loader, 
`FileStoreTable.snapshot_manager()` creates a `SnapshotLoader` backed by the 
REST snapshot API. Snapshot commits likewise use `CatalogSnapshotCommit` and 
attempt to publish through the REST table commit API.
   
   
   ### What doesn't meet your expectations?
   
   an external Paimon table refers to an existing filesystem table. Its 
snapshot files are stored and committed directly in that table's filesystem; 
the REST catalog only provides table metadata. Therefore, PyPaimon should 
access external-table snapshots through the filesystem instead of calling REST 
snapshot and commit endpoints.
   
   With the current behavior, external data can appear missing when the REST 
server has no corresponding snapshot record. Reads and writes also fail if the 
server does not implement or permit external-table snapshot operations. 
Internal REST tables are unaffected and should continue using REST snapshot 
management.
   
   
   ### Anything else?
   
   This should align with Java `CatalogUtils`, which uses `null` as the catalog 
loader for REST external tables:
   
   ```java
   isRestCatalog && metadata.isExternal() ? null : catalog.catalogLoader()
   ```
   
   The fix should also retain `CatalogContext`, so external tables keep 
blob-index caching and REST dependency-read behavior.
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


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