Skip to content

fix(arrow): convert dictionary and fixed-size-binary Arrow types - #978

Open
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/arrow-to-paimon-dictionary-conversion
Open

jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/arrow-to-paimon-dictionary-conversion

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

arrow_to_paimon_type had no arm for Dictionary or FixedSizeBinary, so any Arrow schema carrying them fell through to _ => Unsupported. 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.

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 maps FixedSizeBinary(n) to BINARY(n), rejecting a non-positive length.

Tested at both levels: arrow_to_paimon_type unit cases, and an end-to-end CREATE VIEW over a Dictionary(Int32, Utf8) column that now infers a VARCHAR field instead of erroring.

`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant