Skip to content

Commit ab45719

Browse files
Add const MAX_OFFSET to OffsetSizeTrait (#7478)
1 parent 7905545 commit ab45719

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arrow-array/src/array/list_array.rs

+4
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,20 @@ pub trait OffsetSizeTrait: ArrowNativeType + std::ops::AddAssign + Integer {
4242
const IS_LARGE: bool;
4343
/// Prefix for the offset size
4444
const PREFIX: &'static str;
45+
/// The max `usize` offset
46+
const MAX_OFFSET: usize;
4547
}
4648

4749
impl OffsetSizeTrait for i32 {
4850
const IS_LARGE: bool = false;
4951
const PREFIX: &'static str = "";
52+
const MAX_OFFSET: usize = i32::MAX as usize;
5053
}
5154

5255
impl OffsetSizeTrait for i64 {
5356
const IS_LARGE: bool = true;
5457
const PREFIX: &'static str = "Large";
58+
const MAX_OFFSET: usize = i64::MAX as usize;
5559
}
5660

5761
/// An array of [variable length lists], similar to JSON arrays

0 commit comments

Comments
 (0)