lowka commented on code in PR #4478:
URL: https://github.com/apache/ignite-3/pull/4478#discussion_r1792902647


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctions.java:
##########
@@ -357,8 +357,8 @@ public static BigDecimal toBigDecimal(Number value, int 
precision, int scale) {
     }
 
     /**
-     * Division function for REDUCE phase of AVG aggregate. Precision and 
scale is only used by type inference
-     * (see {@link IgniteSqlOperatorTable#DECIMAL_DIVIDE}, their values are 
ignored at runtime.
+     * Decimal division. Precision is only used by type inferenc, its value is 
ignored at runtime.

Review Comment:
   This operator is used by to compute result of AVG map reduce aggregate (as 
it is written in the javadoc). 
   We use precision/scale parameters in DIVIDE_DECIMAL (see 
IgniteSqlOperatorTable::DECIMAL_DIVIDE) so the result of SUM(x) / COUNT(x) 
returns exactly the same type as AVG(x).
   



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to