You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/30 01:57:13 UTC

[GitHub] [arrow-datafusion] liukun4515 commented on a change in pull request #2107: Minor: Reduce repetition in Decimal binary kernels

liukun4515 commented on a change in pull request #2107:
URL: https://github.com/apache/arrow-datafusion/pull/2107#discussion_r838047597



##########
File path: datafusion-physical-expr/src/expressions/binary.rs
##########
@@ -135,260 +135,192 @@ fn is_not_distinct_from_bool(
 // TODO move decimal kernels to to arrow-rs
 // https://github.com/apache/arrow-rs/issues/1200
 
-// TODO use iter added for for decimal array in
-// https://github.com/apache/arrow-rs/issues/1083
+/// Creates an BooleanArray the same size as `left`,
+/// applying `op` to all non-null elements of left
+fn compare_decimal_scalar<F>(
+    left: &DecimalArray,
+    right: i128,
+    op: F,
+) -> Result<BooleanArray>
+where
+    F: Fn(i128, i128) -> bool,
+{
+    Ok(left
+        .iter()
+        .map(|left| left.map(|left| op(left, right)))

Review comment:
       Does this iter need `sized`?




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