alamb commented on code in PR #2107: URL: https://github.com/apache/arrow-datafusion/pull/2107#discussion_r843201343
########## 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: I think the call to `collect()` eventually needs the iterator to be sized (so it knows how large an array to allocate) -- 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]
