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

   ### Describe the issue this Pull Request addresses
   
   Closes #20670. Trino entry of the type plane in RFC-104 (#18661, Workstream 
D).
   
   The Trino connector never relates `HoodieSchema` to Trino types in one 
place: column types come from the Hive type strings in the metastore.
   
   ### Summary and Changelog
   
   Adds `TrinoTypeMapper`, a plain class with one method, 
`toTypeSystem(HoodieSchema)`, that maps each `HoodieSchemaType` to exactly one 
Trino type.
   
   - Primitives, DECIMAL, DATE, ARRAY, MAP and RECORD map to their Trino 
counterparts.
   - UUID maps to `uuid`, TIME to `time(3)` / `time(6)`.
   - A UTC-adjusted TIMESTAMP maps to `timestamp(3)` / `timestamp(6)` with time 
zone, a local one to `timestamp(3)` / `timestamp(6)`.
   - VECTOR maps to an array of its element type; ENUM to `varchar`; FIXED to 
`varbinary`; BLOB and VARIANT to a row of their fields.
   - Non-nullable unions, NULL and decimals above precision 38 are rejected 
with a reason.
   
   The switch has no default branch, so a new `HoodieSchemaType` does not 
compile until it is mapped. The method is named after 
`TypeSystemMapper#toTypeSystem` in RFC-104.
   
   ### Impact
   
   None at runtime: nothing in the connector calls the mapper yet. Column types 
still come from the metastore, which reports different types for UUID, TIME, 
TIMESTAMP and VECTOR columns. Moving the connector onto the mapper is a 
separate, gated change.
   
   ### Risk Level
   
   none
   
   ### 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