alamb commented on code in PR #3483: URL: https://github.com/apache/arrow-datafusion/pull/3483#discussion_r972010178
########## datafusion/physical-expr/src/expressions/binary/kernels_arrow.rs: ########## @@ -372,14 +372,18 @@ pub(crate) fn multiply_decimal_scalar( Ok(array) } -pub(crate) fn divide_decimal( +pub(crate) fn divide_opt_decimal( left: &Decimal128Array, right: &Decimal128Array, ) -> Result<Decimal128Array> { let mul = 10_f64.powi(left.scale() as i32); let array = arith_decimal(left, right, |left, right| { let l_value = left as f64; let r_value = right as f64; + // TODO: Since this uses f64 division, divide by zero and then casting to i128 + // gives a nasty asnwer: + // 170141183460469231731687303715884105727 + //https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b5949eb324d9828a802aa11b4fa9d029 Review Comment: ```suggestion // casting to i128 doesn't work well when result is NaN // https://github.com/apache/arrow-datafusion/issues/3498 ``` -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org