Gabriel39 opened a new pull request, #69158:
URL: https://github.com/apache/doris/pull/69158

   ### What problem does this PR solve?
   
   A normal SELECT through a Paimon REST catalog can fail with:
   
   ```
   Paimon table generation changed after the statement was pinned; retry the 
statement
   ```
   
   For example, `test_paimon_rest_catalog_write` creates a table and completes 
its INSERT statements, then fails while planning the first SELECT. RESTCatalog 
reconstructs `TableSchema` from a REST `Schema` using `TableSchema.create`. The 
reconstructed creation time, schema-format version, and highest allocated field 
ID need not match the stored schema file. Comparing their full metadata 
therefore reports a replacement even when the table has not changed.
   
   Bind REST file-table schemas to the physical schema at the same ID when 
loading raw catalog metadata, before caching it. Verify that the logical 
fields/keys/comment agree, preserve REST options, FileIO and catalog callbacks, 
and bind fallback branches independently. Cache hits do not rebind retained 
handles. The existing strict schema/snapshot generation checks remain 
unchanged, including rejection of a cached handle after same-path, 
same-schema-ID, same-field DROP/CREATE.
   
   This adds a schema-file read on each REST table cache load, not on cache 
hits. Non-REST catalogs and non-file tables keep their existing path.
   
   ### Validation
   
   - Four new tests reproduce the failure before the fix and pass afterward. 
They cover cache enabled/disabled, synthetic REST metadata, 
option/IO/environment preservation, same-shape replacement with a replacement 
pin, refresh, logical-schema mismatch, and fallback schemas.
   - `mvn -f fe/pom.xml -pl :fe-connector-paimon -am install 
-Dmaven.build.cache.enabled=false` passed, including FE Checkstyle and plugin 
zip assembly: 1,460 tests discovered, zero failures/errors, one existing 
live-connectivity test skipped. The Paimon module has 806 passing tests and the 
same one skip.
   - Extended the REST write regression with a refresh/re-read comparison after 
its existing golden assertion. Groovy syntax compilation and `git diff --check` 
passed.
   
   Unit tests use real local Paimon schema files and SDK schema reconstruction 
with a recording REST catalog. A live REST/DLF environment was not exercised 
locally; the external regression remains for CI. The existing live test skips 
when `PAIMON_WAREHOUSE` is not configured.
   
   ### Release note
   
   Fix false table-generation-change errors when reading tables through Paimon 
REST catalogs.
   
   ### Check List (For Author)
   
   - [x] Unit Test
   - [x] Regression test extension
   - [x] Behavior changed: valid REST table schemas are accepted while retained 
generation checks remain strict
   - [x] No documentation needed
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to