You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by zs...@apache.org on 2024/12/13 07:16:07 UTC
(ignite-3) branch ignite-23976 created (now b2dc667c13)
This is an automated email from the ASF dual-hosted git repository.
zstan pushed a change to branch ignite-23976
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
at b2dc667c13 IGNITE-23976 Sql. NumericMergeSourcesCoercionTest#mergeWithLiteralValue is flaky after calcite version change
This branch includes the following new commits:
new b2dc667c13 IGNITE-23976 Sql. NumericMergeSourcesCoercionTest#mergeWithLiteralValue is flaky after calcite version change
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(ignite-3) 01/01: IGNITE-23976 Sql. NumericMergeSourcesCoercionTest#mergeWithLiteralValue is flaky after calcite version change
Posted by zs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zstan pushed a commit to branch ignite-23976
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit b2dc667c13c080aa43ac8465c613e0c603e24952
Author: zstan <zs...@apache.com>
AuthorDate: Fri Dec 13 10:15:37 2024 +0300
IGNITE-23976 Sql. NumericMergeSourcesCoercionTest#mergeWithLiteralValue is flaky after calcite version change
---
.../java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java | 2 +-
.../ignite/internal/sql/engine/datatypes/ItDivisionDecimalTest.java | 3 ++-
.../sql/group1/aggregate/aggregates/test_aggr_string.test | 2 +-
.../java/org/apache/ignite/internal/sql/engine/util/IgniteMath.java | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java
index 5066bf2e43..56c3bde117 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java
@@ -831,7 +831,7 @@ public class ItDataTypesTest extends BaseSqlIntegrationTest {
arguments(decimalType(1, 1), new BigDecimal("0.1"), decimalType(1, 1), bigDecimalVal("0.1")),
arguments(decimalType(3), new BigDecimal("100"), decimalType(3), bigDecimalVal("100")),
// passed with runtime call and failed with parsing substitution
- arguments(decimalType(5, 2), new BigDecimal("100.16"), decimalType(4, 1), bigDecimalVal("100.2")),
+ arguments(decimalType(5, 2), new BigDecimal("100.16"), decimalType(4, 1), bigDecimalVal("100.1")),
arguments(decimalType(3), new BigDecimal("100"), decimalType(3, 0), bigDecimalVal("100")),
arguments(decimalType(3), new BigDecimal("100"), decimalType(4, 1), bigDecimalVal("100.0")),
arguments(decimalType(3), new BigDecimal("100"), decimalType(2, 0), error(NUMERIC_OVERFLOW_ERROR)),
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/ItDivisionDecimalTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/ItDivisionDecimalTest.java
index fea774bf8b..44a52eba31 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/ItDivisionDecimalTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/ItDivisionDecimalTest.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.sql.engine.datatypes;
import static org.apache.ignite.internal.lang.IgniteStringFormatter.format;
+import static org.apache.ignite.internal.sql.engine.util.IgniteMath.ROUNDING_MODE;
import java.math.BigDecimal;
import java.math.RoundingMode;
@@ -96,7 +97,7 @@ public class ItDivisionDecimalTest extends BaseSqlIntegrationTest {
BigDecimal a1 = IgniteTestUtils.randomBigDecimal(rnd, t1.getPrecision(), t1.getScale());
BigDecimal a2 = IgniteTestUtils.randomBigDecimal(rnd, t2.getPrecision(), t2.getScale());
- BigDecimal rs = a1.divide(a2, rt.getScale(), RoundingMode.HALF_UP);
+ BigDecimal rs = a1.divide(a2, rt.getScale(), ROUNDING_MODE);
String type1 = format("DECIMAL({}, {})", p1, s1);
String type2 = format("DECIMAL({}, {})", p2, s2);
diff --git a/modules/sql-engine/src/integrationTest/sql/group1/aggregate/aggregates/test_aggr_string.test b/modules/sql-engine/src/integrationTest/sql/group1/aggregate/aggregates/test_aggr_string.test
index 12e7e9112e..05e3575adf 100644
--- a/modules/sql-engine/src/integrationTest/sql/group1/aggregate/aggregates/test_aggr_string.test
+++ b/modules/sql-engine/src/integrationTest/sql/group1/aggregate/aggregates/test_aggr_string.test
@@ -55,7 +55,7 @@ SELECT COUNT(*), COUNT(s) FROM test;
query I
SELECT AVG(a) FROM test;
----
-11.4285714285714286
+11.4285714285714285
query II
SELECT AVG(a), COUNT(DISTINCT(s)) FROM test;
diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/IgniteMath.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/IgniteMath.java
index 75a108c22b..5f6d9063e4 100644
--- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/IgniteMath.java
+++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/IgniteMath.java
@@ -48,7 +48,7 @@ public class IgniteMath {
private static final double LOWER_FLOAT_DOUBLE = Double.parseDouble("" + (-Float.MAX_VALUE));
/** Decimal rounding mode. */
- public static final RoundingMode ROUNDING_MODE = RoundingMode.HALF_UP;
+ public static final RoundingMode ROUNDING_MODE = RoundingMode.DOWN;
/** Returns the sum of its arguments, throwing an exception if the result overflows an {@code long}. */
public static long addExact(long x, long y) {