korlov42 commented on code in PR #2690:
URL: https://github.com/apache/ignite-3/pull/2690#discussion_r1365060711
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctions.java:
##########
@@ -128,9 +128,54 @@ 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) {
+ return sround(BigDecimal.valueOf(b0)).intValue();
Review Comment:
can we avoid creating BigDecimal for primitive types?
--
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]