fix(arrow): convert dictionary and fixed-size-binary Arrow types - #978
Open
jackylee-ch wants to merge 1 commit into
Open
jackylee-ch wants to merge 1 commit into
jackylee-ch wants to merge 1 commit into
Conversation
`arrow_to_paimon_type` had no arm for `Dictionary` or `FixedSizeBinary`, so any Arrow schema carrying them hit the `_ => Unsupported` fallback. DataFusion encodes low-cardinality string columns as `Dictionary(Int32, Utf8)`, so `CREATE VIEW v AS SELECT ...` (and any other `arrow_fields_to_paimon` caller) failed with "Unsupported Arrow type for Paimon conversion" even though the same query ran fine. Resolve a dictionary to its value type (the key is a physical encoding detail, matching how the codebase already unwraps dictionaries elsewhere) and map `FixedSizeBinary(n)` to `BINARY(n)`, rejecting a non-positive length.
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.
arrow_to_paimon_typehad no arm forDictionaryorFixedSizeBinary, so any Arrow schema carrying them fell through to_ => Unsupported. DataFusion encodes low-cardinality string columns asDictionary(Int32, Utf8), soCREATE VIEW v AS SELECT ...(and any otherarrow_fields_to_paimoncaller) failed with "Unsupported Arrow type for Paimon conversion" even though the same query ran fine.This resolves a dictionary to its value type — the key is a physical encoding detail, matching how the codebase already unwraps dictionaries in
residual.rs/vortex.rs/update_input.rs— and mapsFixedSizeBinary(n)toBINARY(n), rejecting a non-positive length.Tested at both levels:
arrow_to_paimon_typeunit cases, and an end-to-endCREATE VIEWover aDictionary(Int32, Utf8)column that now infers aVARCHARfield instead of erroring.