korlov42 commented on code in PR #2690:
URL: https://github.com/apache/ignite-3/pull/2690#discussion_r1368523867


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctions.java:
##########
@@ -128,9 +128,78 @@ public static int length(Object b) {
         return b instanceof ByteString ? octetLength((ByteString) b) : 
charLength((String) b);
     }
 
-    private static BigDecimal setScale(int precision, int scale, BigDecimal 
decimal) {
-        return precision == 
IgniteTypeSystem.INSTANCE.getDefaultPrecision(SqlTypeName.DECIMAL)
-            ? decimal : decimal.setScale(scale, RoundingMode.HALF_UP);
+    // SQL ROUND function
+
+    /** SQL {@code ROUND} operator applied to int values. */
+    public static int sround(int b0) {

Review Comment:
   although such set of overrides are working correctly for every numeric type, 
ExpressionFactory can't generate optimal code. Try to change tests in order to 
use dynamic params rather constants, and print out generated code of 
expressions to see difference



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

Reply via email to