moraistejerina opened a new pull request, #25015:
URL: https://github.com/apache/datafusion/pull/25015

   ## Which issue does this PR close?
   
   N/A
   
   ## Rationale for this change
   
   `consume_user_defined_type` maps a Substrait user-defined type straight to a 
bare `DataType`, so a consumer has no way to mark the resulting `Field` for a 
downstream reader to recover semantic type lost in that mapping. For example, a 
UDT representing JSON is commonly mapped to plain `Utf8`, which is then 
indistinguishable from a real string column once it reaches a consumer that 
only sees the Arrow schema (e.g. over Arrow Flight, with no access to the 
original plan).
   
   ## What changes are included in this PR?
   
   - Adds `consume_user_defined_type_metadata`, a second, additive extension 
point on `SubstraitConsumer` defaulting to `Ok(None)`.
   - Applies its result to the `Field` built in `from_substrait_struct_type`, 
via `Field::with_metadata`.
   - Existing consumers are unaffected: the default keeps today's behavior 
exactly (no metadata attached).
   
   ## Are these changes tested?
   
   Yes, two new unit tests: a consumer that supplies metadata for a 
`UserDefined` field gets it attached to the field (data type unchanged), and a 
consumer returning `None` (the default) attaches nothing.
   
   ## Are there any user-facing changes?
   
   No behavior change for existing consumers. This is a new, optional trait 
method with a default implementation.


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