You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/02/11 21:58:14 UTC

[PR] Alamb/specialized group keys skip overflow [arrow-datafusion]

alamb opened a new pull request, #9196:
URL: https://github.com/apache/arrow-datafusion/pull/9196

   Variation of https://github.com/apache/arrow-datafusion/pull/8827 that uses https://github.com/apache/arrow-rs/pull/5388 to avoid offset overflow checking in the hot loop


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Alamb/specialized group keys skip overflow [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed pull request #9196: Alamb/specialized group keys skip overflow
URL: https://github.com/apache/arrow-datafusion/pull/9196


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Alamb/specialized group keys skip overflow [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9196:
URL: https://github.com/apache/arrow-datafusion/pull/9196#issuecomment-1937897716

   Actually, it turns out this is part of arrow (`usize_as`) so I will put it directly into https://github.com/apache/arrow-datafusion/pull/8827


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Alamb/specialized group keys skip overflow [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9196:
URL: https://github.com/apache/arrow-datafusion/pull/9196#discussion_r1485673107


##########
datafusion/physical-expr/src/binary_map.rs:
##########
@@ -364,7 +364,9 @@ where
                     let null_index = self.offsets.len() - 1;
                     // nulls need a zero length in the offset buffer
                     let offset = self.buffer.len();
-                    self.offsets.push(O::from_usize(offset).unwrap());
+                    // safety: check for overflows at the end
+                    let offset = unsafe { O::from_usize_unchecked(offset)} ;

Review Comment:
   this skips overflow checking so if the buffer length is larger than can fit in a i32 it will overflow on strings
   
   I added a check at the end 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org