a-narsudinov opened a new pull request, #20643:
URL: https://github.com/apache/hudi/pull/20643

   ### Describe the issue this Pull Request addresses
   
   An initialized Hudi table can have `hoodie.properties` and a metastore entry 
before its first completed write. The Trino connector currently throws 
`HUDI_NO_VALID_COMMIT` when resolving the latest commit, preventing queries 
against an otherwise valid empty table.
   
   Both `SELECT count(*)` and ordinary column projections fail instead of 
returning an empty result.
   
   ### Summary and Changelog
   
   Treat initialized tables without completed commits as empty tables.
   
   - Allow the table handle to represent the absence of a completed commit.
   - Return an empty split source before partition discovery or index planning.
   - Avoid resolving a committed data schema or merge-required columns when 
serializing an empty-table handle.
   - Add a SQL regression that initializes and registers a table without 
writing any commits.
   - Verify that `count(*)` returns zero and a column projection returns no 
rows with metadata and column-name case resolution independently enabled and 
disabled.
   
   Validation: both tests in `TestHudiEmptyTables` passed.
   
   ### Impact
   
   Allows Trino users to query initialized Hudi tables before their first 
completed write. Tables with completed commits retain their existing scan 
behavior.
   
   No configuration or storage-format changes.
   
   ### Risk Level
   
   low — The change introduces an early empty-scan path for tables without 
completed commits. SQL coverage verifies the behavior across all four 
combinations of metadata and column-name case-resolution settings.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable


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