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



##########
File path: datafusion/src/physical_plan/expressions/binary.rs
##########
@@ -49,6 +53,62 @@ use super::coercion::{
     eq_coercion, like_coercion, numerical_coercion, order_coercion, 
string_coercion,
 };
 
+// Simple (low performance) kernels until optimized kernels are added to arrow
+// TODO: file arrow-rs ticket to track this feature
+
+fn is_distinct_from_bool(
+    left: &BooleanArray,
+    right: &BooleanArray,
+) -> Result<BooleanArray> {
+    // Different from `eq` beacause not eq_bool because null == null
+    Ok(left
+        .iter()
+        .zip(right.iter())
+        .map(|(left, right)| Some(left != right))
+        .collect())
+}
+
+fn is_not_distinct_from_bool(
+    left: &BooleanArray,
+    right: &BooleanArray,
+) -> Result<BooleanArray> {
+    Ok(left
+        .iter()
+        .zip(right.iter())
+        .map(|(left, right)| Some(left == right))
+        .collect())
+}
+
+#[allow(clippy::bool_comparison)]

Review comment:
       ```suggestion
   // TODO use arrow-rs kernels when available. See
   // https://github.com/apache/arrow-rs/issues/959
   #[allow(clippy::bool_comparison)]
   ```

##########
File path: datafusion/src/physical_plan/expressions/binary.rs
##########
@@ -49,6 +53,62 @@ use super::coercion::{
     eq_coercion, like_coercion, numerical_coercion, order_coercion, 
string_coercion,
 };
 
+// Simple (low performance) kernels until optimized kernels are added to arrow
+// TODO: file arrow-rs ticket to track this feature

Review comment:
       ```suggestion
   // See https://github.com/apache/arrow-rs/issues/960
   ```

##########
File path: datafusion/src/physical_plan/expressions/binary.rs
##########
@@ -49,6 +53,62 @@ use super::coercion::{
     eq_coercion, like_coercion, numerical_coercion, order_coercion, 
string_coercion,
 };
 
+// Simple (low performance) kernels until optimized kernels are added to arrow
+// TODO: file arrow-rs ticket to track this feature

Review comment:
       filed https://github.com/apache/arrow-rs/issues/960

##########
File path: datafusion/src/physical_plan/expressions/binary.rs
##########
@@ -126,6 +186,47 @@ macro_rules! compute_utf8_op_scalar {
     }};
 }
 
+/// Invoke a compute kernel on a boolean data array and a scalar value
+macro_rules! compute_bool_op_scalar {
+    ($LEFT:expr, $RIGHT:expr, $OP:ident, $DT:ident) => {{
+        use std::convert::TryInto;
+        let ll = $LEFT
+            .as_any()
+            .downcast_ref::<$DT>()
+            .expect("compute_op failed to downcast array");
+        // generate the scalar function name, such as lt_scalar, from the $OP 
parameter
+        // (which could have a value of lt) and the suffix _scalar
+        Ok(Arc::new(paste::expr! {[<$OP _bool_scalar>]}(

Review comment:
       For the record this pattern is used elsewhere in this file, I was just 
following it :)




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