This is an automated email from the ASF dual-hosted git repository. zstan pushed a commit to branch ignite-22580 in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 744cec5799771b3a328d2c061298a5758fb6487a Author: zstan <[email protected]> AuthorDate: Tue Jul 23 12:38:20 2024 +0300 initial --- .../apache/ignite/internal/sql/engine/ItDataTypesTest.java | 1 + .../datatypes/NumericBinaryOperationsTypeCoercionTest.java | 11 +++++++++++ 2 files changed, 12 insertions(+) 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 98b5004017..afd7d33e25 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 @@ -78,6 +78,7 @@ public class ItDataTypesTest extends BaseSqlIntegrationTest { /** Tests correctness with unicode. */ @Test public void testUnicodeStrings() { + sql("select decode(?, 0, 0, 1, 1.0)", 0); sql("CREATE TABLE string_table(key int primary key, val varchar)"); String[] values = {"Кирилл", "Müller", "我是谁", "ASCII"}; diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericBinaryOperationsTypeCoercionTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericBinaryOperationsTypeCoercionTest.java index 02acf8e11f..1de4596f56 100644 --- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericBinaryOperationsTypeCoercionTest.java +++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericBinaryOperationsTypeCoercionTest.java @@ -51,6 +51,17 @@ public class NumericBinaryOperationsTypeCoercionTest extends BaseTypeCoercionTes assertPlan("SELECT c2 + c1 FROM t", schema, operandMatcher(second, first)::matches, List.of()); } + @ParameterizedTest + @MethodSource("allNumericPairs") + public void t0(NumericPair pair) throws Exception { + IgniteSchema schema = createSchemaWithTwoColumnTable(pair.first(), pair.second()); + + Matcher<RexNode> first = ofTypeWithoutCast(pair.first()); + Matcher<RexNode> second = ofTypeWithoutCast(pair.second()); + + assertPlan("SELECT CASE WHEN c1>(SELECT avg(c1) FROM t) THEN c1 ELSE c2 END FROM t", schema, operandMatcher(first, second)::matches, List.of()); + } + // No any type changes for `subtraction` operation from planner perspective. @ParameterizedTest @MethodSource("allNumericPairs")
