alamb commented on a change in pull request #1653:
URL: https://github.com/apache/arrow-datafusion/pull/1653#discussion_r796043150



##########
File path: datafusion/src/physical_plan/expressions/binary.rs
##########
@@ -334,6 +334,100 @@ fn modulus_decimal(left: &DecimalArray, right: 
&DecimalArray) -> Result<DecimalA
     Ok(decimal_builder.finish())
 }
 
+/// The binary_bitwise_array_op macro only evaluates for integer types
+/// like int64, int32.
+/// It is used to do bitwise operation.
+macro_rules! binary_bitwise_array_op {
+    ($LEFT:expr, $RIGHT:expr, $OP:tt, $ARRAY_TYPE:ident, $TYPE:ty) => {{
+        let len = $LEFT.len();
+        let left = $LEFT.as_any().downcast_ref::<$ARRAY_TYPE>().unwrap();
+        let right = $RIGHT.as_any().downcast_ref::<$ARRAY_TYPE>().unwrap();
+        let result = (0..len)
+            .into_iter()
+            .map(|i| {
+                if left.is_null(i) || right.is_null(i) {
+                    None
+                } else {
+                    Some(left.value(i) & right.value(i))

Review comment:
       Changed in 
https://github.com/apache/arrow-datafusion/pull/1653/commits/f81bffb326609be62e7468073ddc69f22171b69f
 (I was trying to make a follow on PR but then I found the logical conflict so 
I figured I would fix it directly on this PR). 
   
   I hope that is OK with you




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


Reply via email to