Repository navigation
Cherry-pick apache/datafusion#25015 onto branch-55 - #179
Merged
moraistejerina merged 1 commit intoSep 8, 2026
Merged
moraistejerina merged 1 commit into
moraistejerina merged 1 commit into
Conversation
…r-defined types (apache#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. (cherry picked from commit d682553)
gabotechs
approved these changes
Sep 8, 2026
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## branch-55 #179 +/- ##
===========================================
Coverage 81.15% 81.15%
===========================================
Files 1110 1110
Lines 386489 386654 +165
Branches 386489 386654 +165
===========================================
+ Hits 313636 313806 +170
Misses 54362 54362
+ Partials 18491 18486 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
moraistejerina
deleted the
jorge.morais/cherry-pick/apache-pr-25015-branch-55-20260908
branch
September 8, 2026 13:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cherry-picks apache#25015 (merged as d682553) onto branch-55.
Same change as #178 (merged into branch-54 as b41aefa), requested by query-execution so it survives the 54->55 upgrade. Adds
SubstraitConsumer::consume_type_metadata(&Type), an extension point letting a consumer attach Arrow field metadata to a Substrait type Arrow can't natively represent, applied via a single attach point (substrait_type_to_field) so nested types (list/map/struct) keep metadata too.