Skip to content

Conversation

@kumarUjjawal
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Sqllogictest was failing in Substrait round trip

query failed: DataFusion error: This feature is not implemented: Unsupported cast type: FixedSizeList

What changes are included in this PR?

  • Added FixedSizeList support to both producer and consumer
    types.rs Producer encodes FixedSizeList as Substrait List with variation ref 3 + size. Consumer decodes back when variation ref >= 3.

Are these changes tested?

Yes

Are there any user-facing changes?

@github-actions github-actions bot added the substrait Changes to the substrait crate label Jan 9, 2026
Comment on lines 58 to 64
/// Used for the arrow type [`DataType::FixedSizeList`].
///
/// The size of the fixed list is encoded by adding it to this base value.
/// For example, `FixedSizeList(10)` would use variation reference `3 + 10 = 13`.
///
/// [`DataType::FixedSizeList`]: datafusion::arrow::datatypes::DataType::FixedSizeList
pub const FIXED_SIZE_LIST_TYPE_VARIATION_REF: u32 = 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a smart way of representing the size of a list!

However, I imagine this can easily backfire in the future if different type variation refs are needed for lists, as this approach eliminates the option to add new ones.

I see two possible paths forward:

  1. Convince the Substrait community that adding a new FixedSizeList type to the Substrait specification is worth it. There's an open issue about this Support FixedSizeList type substrait-io/substrait#873
  2. Implement this as a user defined type, same as what we did for Float16: https://github.com/apache/datafusion/blob/main/datafusion/substrait/src/logical_plan/producer/types.rs#L111-L120

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I didn't think of that. Thanks for pointing that out.

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.

[substrait] [sqllogictest] Unsupported cast type: FixedSizeList

2 participants