-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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:
datafusion/datafusion/expr-common/src/signature.rs
Lines 41 to 44 in f363e38
/// 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:
datafusion/datafusion/expr/src/type_coercion/functions.rs
Lines 877 to 889 in f363e38
// 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
alamb
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request