You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/03/03 13:35:05 UTC
[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #5465: `compute_decimal_op_dyn_scalar` should not cast lhs array to decimal array
alamb commented on code in PR #5465:
URL: https://github.com/apache/arrow-datafusion/pull/5465#discussion_r1124461718
##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -150,9 +150,8 @@ impl std::fmt::Display for BinaryExpr {
macro_rules! compute_decimal_op_dyn_scalar {
($LEFT:expr, $RIGHT:expr, $OP:ident, $OP_TYPE:expr) => {{
- let ll = as_decimal128_array($LEFT).unwrap();
if let ScalarValue::Decimal128(Some(v_i128), _, _) = $RIGHT {
- Ok(Arc::new(paste::expr! {[<$OP _dyn_scalar>]}(ll, v_i128)?))
+ Ok(Arc::new(paste::expr! {[<$OP _dyn_scalar>]}($LEFT, v_i128)?))
Review Comment:
it makes sense to me not to cast the left hand side
In general, now that the dyn kernels are more complete, I wonder if we need the specific decimal macros at all 🤔
--
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