Raunak Bhagat
12/10/2024, 3:21 AMarrow2::array::BinaryArray<i64> produces an iterator over Option<&[u8]>? I would have expected it to produce an iterator over `Option<i64>`s...Kevin Wang
12/10/2024, 3:25 AMRaunak Bhagat
12/10/2024, 3:28 AM&[u8] subslice inside of each element is of the same length, correct?Kevin Wang
12/10/2024, 3:29 AMRaunak Bhagat
12/10/2024, 3:31 AMOption<&[u8]>, right.
Thus, we should observe that:
let first: Option<&[u8]> = binary_array.next().unwrap();
let second: Option<&[u8]> = binary_array.next().unwrap();
first.unwrap().len() == second.unwrap().len()
(And thus similarly for all other elements)Kevin Wang
12/10/2024, 3:32 AMKevin Wang
12/10/2024, 3:32 AMKevin Wang
12/10/2024, 3:33 AMRaunak Bhagat
12/10/2024, 3:33 AMKevin Wang
12/10/2024, 3:37 AMCory Grinstead
12/10/2024, 3:52 AMBinaryArray implementations
• Binary
• LargeBinary
in arrow2 , the generic parameter is the offset, so it's really mutually exclusive to either i32 | i64
Binary is equivalent to BinaryArray<i32>
and LargeBinary is BinaryArray<i64>.
The parameterized type really is just an optimization. I believe we mostly use the LargeBinary implementation, but in some scenario's where you know you wont exceed the limitations of BinaryArray<i32>, (approx 2gb per item), then it could be a good choice as it has a smaller footprint than the i64 offset
TL;DR;
It's very conceptually similar to a Bytes type/class, and the i64 represents the offset, not the inner data type.