Jefffrey commented on code in PR #11546:
URL: https://github.com/apache/arrow-rs/pull/11546#discussion_r4267040731
##########
arrow-data/src/transform/run.rs:
##########
@@ -230,6 +230,8 @@ pub fn build_extend(array: &ArrayData) -> Extend<'_> {
// Build run ends and values indices directly for batch processing
macro_rules! build_and_process_impl {
($run_end_type:ty) => {{
+ let source_buffer = &source_buffer.typed_data()
+ [source_buffer_offset..source_buffer_offset +
source_buffer_len];
Review Comment:
in practice it would be uncommon to have a runarray hit this case, of having
a runs child arraydata with an offset as it requires manual construction
- its similar to https://github.com/apache/arrow-rs/pull/11536
##########
arrow-data/src/transform/run.rs:
##########
@@ -58,8 +58,9 @@ pub fn extend_nulls(mutable: &mut _MutableArrayData, len:
usize) -> Result<(), A
macro_rules! extend_nulls_impl {
($run_end_type:ty) => {{
let last_run_end =
get_last_run_end::<$run_end_type>(&mutable.child_data[0]);
- let new_value = last_run_end
- .checked_add(<$run_end_type as ArrowNativeType>::usize_as(len))
Review Comment:
`len` is a usize, if it is > `i16::MAX` and the run index type is `i16` the
this could wrap to negative
swapping in `from_usize` which can chain into `checked_add` and share the
same `ok_or_else` flow
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]