kazuyukitanimura commented on code in PR #1428:
URL: https://github.com/apache/datafusion-comet/pull/1428#discussion_r1972648463


##########
native/core/src/execution/planner.rs:
##########
@@ -922,13 +956,18 @@ impl PhysicalPlanner {
                 Ok(DataType::Decimal128(_p2, _s2)),
             ) => {
                 let data_type = return_type.map(to_arrow_datatype).unwrap();
+                let func_name = if options.is_integral_div {

Review Comment:
   I just realized, we maybe able to reuse the previous case-match instead of 
here. 
   We needed to treat `decimal_div` differently because we had to deal with 
rounding. However we just need to round down for IntegralDivide?
    I.e. instead of 77digits for scale, we only need 76digits that fits into 
Decimal256
   
   Will need a similar calculation to
   ```
                   || (op == DataFusionOperator::Modulo
                       && max(s1, s2) as u8 + max(p1 - s1 as u8, p2 - s2 as u8)
                           > DECIMAL128_MAX_PRECISION) 
   ```
   
   In this way, we do not need the  `decimal_div` change?



-- 
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...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to