Dandandan commented on code in PR #19975:
URL: https://github.com/apache/datafusion/pull/19975#discussion_r2724245655


##########
datafusion/physical-expr-common/src/binary_view_map.rs:
##########
@@ -267,24 +272,32 @@ where
                 };
                 observe_payload_fn(payload);
                 continue;
-            };
+            }
+
+            // Extract length from the view (first 4 bytes of u128)
+            // This is used for potential future optimizations
+            let _len = (view_u128 & 0xFFFFFFFF) as u32;
 
-            // get the value as bytes
-            let value: &[u8] = value.as_ref();
+            // Get the input value - Arrow's value() method is already 
optimized
+            // to handle inline strings efficiently
+            let input_value: &[u8] = values.value(i).as_ref();

Review Comment:
   This part is slow for inlined bytes (u128) as it converts it back to `&[u8]` 
.
   
   We should avoid it if we know either
   * all views are inlined (e.g. no buffer)
   * this view is inlined (length < 12)



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to