Skip to content

Introduce wildcard const for FixedSizeBinary #17291

@Jefffrey

Description

@Jefffrey

Is your feature request related to a problem or challenge?

Original discussion: #17179 (comment)

It's hard to specify a type signature that includes an arbitrarily sized FixedSizeBinary as would need to specify each and every size; ideally would be solved by a wildcard, similar to how it's handled for FixedSizeList:

Wildcard:

/// Constant that is used as a placeholder for any valid fixed size list.
/// This is used where a function can accept a fixed size list type with any
/// valid length. It exists to avoid the need to enumerate all possible fixed size list lengths.
pub const FIXED_SIZE_LIST_WILDCARD: i32 = i32::MIN;

How wildcard is used:

// should be able to coerce wildcard fixed size list to non wildcard fixed size list
(
FixedSizeList(f_into, FIXED_SIZE_LIST_WILDCARD),
FixedSizeList(f_from, size_from),
) => match coerced_from(f_into.data_type(), f_from.data_type()) {
Some(data_type) if &data_type != f_into.data_type() => {
let new_field =
Arc::new(f_into.as_ref().clone().with_data_type(data_type));
Some(FixedSizeList(new_field, *size_from))
}
Some(_) => Some(FixedSizeList(Arc::clone(f_into), *size_from)),
_ => None,
},

Describe the solution you'd like

Introduce a wildcard const for FixedSizeBinary to use during coercion

Describe alternatives you've considered

No response

Additional context

Fix any type signatures that use FixedSizeBinary to use this new wildcard, for example in #17179 code

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions