liujiayi771 opened a new pull request, #4961:
URL: https://github.com/apache/incubator-gluten/pull/4961

   ## What changes were proposed in this pull request?
   
   When the input decimal precision is very large, the precision of sum and avg 
may exceed 38, and we should not infer the intermediate type based on the 
result type in decimal sum/avg functions, we should always infer the 
intermediate type and result type based on the raw input type.
   
   For example, in average aggregate function:
   input = decimal(p, s)
   intermediate = row(decimal(min(38, p + 10), s), bigint)
   result = decimal(min(38, p + 4), min(38, s + 4))
   
   We should not infer intermediate type by using result precision + 6, it is 
not correct when p > 34.
   
   Add some test cases with large precision to prevent future modifications to 
decimal avg sum from introducing errors.
   
   ## How was this patch tested?
   
   Add large precision test cases in avg and sum `VeloxAggregateFunctionsSuite`.
   
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to