You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mingmwang (via GitHub)" <gi...@apache.org> on 2023/04/07 10:14:22 UTC

[GitHub] [arrow-datafusion] mingmwang commented on a diff in pull request #5866: Improve avg/sum Aggregator performance for Decimal

mingmwang commented on code in PR #5866:
URL: https://github.com/apache/arrow-datafusion/pull/5866#discussion_r1160604767


##########
datafusion/physical-expr/src/aggregate/utils.rs:
##########
@@ -31,3 +33,49 @@ pub fn get_accum_scalar_values_as_arrays(
         .map(|s| s.to_array_of_size(1))
         .collect::<Vec<_>>())
 }
+
+pub fn calculate_result_decimal_for_avg(

Review Comment:
   I think it is a little bit different then the explicit arithmetic expression in the SQL,  the reason is this final result decimal conversion is implicit, the logical plans/optimizers actually are not aware of this implicit conversion. This is similar to the implicit `cast` that I pulled up this PR, the cast is also implicit and the logical plans/optimizers is not aware of this implicit `cast` either. Those implicit `cast` and conversion is only related to internal state of some specific Aggregation `Accumulator`, that are not part of the SQL plans/expressions tree.
   
   
   



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