Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Came up when working on apache/datafusion#15968. Since working with native code offsets will generally be usize it would be nice to have generic way to get max usize value for OffsetSizeTrait instead of deriving it at runtime
Describe the solution you'd like
pub trait OffsetSizeTrait: ArrowNativeType + std::ops::AddAssign + Integer {
const MAX_OFFSET:usize
...
}
impl OffsetSizeTrait for i32 {
const MAX_OFFSET: usize = i32::MAX as usize;
..
}
impl OffsetSizeTrait for i64 {
const MAX_OFFSET: usize = i64::MAX as usize;
..
}
Describe alternatives you've considered
Can do it like it's done in the above PR by deriving at runtime based on IS_LARGE
Additional context
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Came up when working on apache/datafusion#15968. Since working with native code offsets will generally be
usizeit would be nice to have generic way to get maxusizevalue forOffsetSizeTraitinstead of deriving it at runtimeDescribe the solution you'd like
Describe alternatives you've considered
Can do it like it's done in the above PR by deriving at runtime based on
IS_LARGEAdditional context