OjashKush opened a new pull request, #20012:
URL: https://github.com/apache/hudi/pull/20012

   ### Describe the issue this Pull Request addresses
   
   The Hudi Trino connector cannot natively create or drop empty Hudi tables, 
or register and unregister existing tables.
   
   This implements Stage 1 from [discussion 
#19484](https://github.com/apache/hudi/discussions/19484) and is part of 
#15527. It intentionally does not add row-writing support.
   
   ### Summary and Changelog
   
   - Implement `createTable` and `dropTable` in the connector metadata layer:
     - derive managed locations from the schema and treat explicit locations as 
external;
     - require an empty target location and clean up `.hoodie` metadata if 
catalog registration fails;
     - delete storage for managed tables while preserving external table data.
   - Add table-property validation and Trino-to-Hudi schema conversion. The 
same schema is used for both `hoodie.table.create.schema` and the metastore 
columns.
   - Initialize Hudi table version 10 metadata through `hudi-common` and the 
Trino storage adapter, without using a write client or creating data commits.
   - Add an engine-neutral metastore descriptor in `hudi-sync-common` for 
COW/MOR storage formats, partition/data columns, SerDe settings, and Spark 
datasource properties.
   - Add `system.register_table`, which reads the existing Hudi table type, 
schema, and partition fields before creating an external metastore entry.
   - Add `system.unregister_table`, which validates the Hudi table and removes 
only its metastore entry.
   - Keep `INSERT`, CTAS, `MERGE`, page sinks, `beginCreateTable`, and 
`finishCreateTable` unsupported.
   
   ### Impact
   
   Users can manage empty Hudi tables and metastore registrations through Trino 
SQL without writing data rows. Registering or unregistering a table does not 
modify its existing Hudi metadata or data.
   
   ### Risk Level
   
   medium
   
   The change introduces catalog and storage mutations. Tests cover managed and 
external tables, initialization rollback, empty-table reads, registration, 
unregistration, and data preservation.
   
   <details>
   <summary>Verification</summary>
   
   - Focused Stage 1 suite: 57 tests passed
   - Shared metastore descriptor: 15 tests passed
   - Hive-sync descriptor parity: 4 tests passed
   - Connector contract suite: 271 tests run, 0 failures or errors, 149 skipped
   
   </details>
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through the [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
   
   Related to #15527
   


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