Dandandan commented on code in PR #7731:
URL: https://github.com/apache/arrow-rs/pull/7731#discussion_r2160332637


##########
arrow-ord/src/cmp.rs:
##########
@@ -626,6 +645,16 @@ pub fn compare_byte_view<T: ByteViewType>(
 ) -> std::cmp::Ordering {
     assert!(left_idx < left.len());
     assert!(right_idx < right.len());
+    if left.data_buffers().is_empty() && right.data_buffers().is_empty() {
+        // Only need to compare the inlined bytes
+        let l_bytes = unsafe {
+            
GenericByteViewArray::<T>::inline_value(left.views().get_unchecked(left_idx), 
12)

Review Comment:
   Hmm I think this might not be correct for > / < in case of zeros in the 
values (e.g. https://en.wikipedia.org/wiki/Null_character).
   I think we should add the length to the comparison (or do something smarter? 
I am not sure if that's possible).



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to