Skip to content

Support dictionary literals in Substrait producer#22041

Draft
alexanderbianchi wants to merge 1 commit intoapache:branch-53from
alexanderbianchi:codex/substrait-dictionary-literals
Draft

Support dictionary literals in Substrait producer#22041
alexanderbianchi wants to merge 1 commit intoapache:branch-53from
alexanderbianchi:codex/substrait-dictionary-literals

Conversation

@alexanderbianchi
Copy link
Copy Markdown
Contributor

@alexanderbianchi alexanderbianchi commented May 6, 2026

Rationale for this change

The Substrait producer currently fails when a logical plan contains a ScalarValue::Dictionary, for example a string literal that was coerced to match a dictionary-encoded string column. Dictionary encoding is a physical representation detail; the Substrait literal should carry the logical inner value.

What changes are included in this PR?

This unwraps ScalarValue::Dictionary(_, value) in the Substrait literal producer and serializes the inner scalar value. It also adds a regression test showing a dictionary-encoded UTF8 scalar is emitted as a string literal and round trips as the logical UTF8 scalar.

Are these changes tested?

Yes:

cargo +1.91 test -p datafusion-substrait dictionary_literals_are_serialized_as_inner_values -- --nocapture

@github-actions github-actions Bot added the substrait Changes to the substrait crate label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant