You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by jo...@apache.org on 2024/06/20 07:52:17 UTC

(ignite-3) 01/01: IGNITE-22462 Add planner test to verify type coercion for set operations like UNION, INTERSECT and EXCEPT

This is an automated email from the ASF dual-hosted git repository.

jooger pushed a commit to branch ignite-22462
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit 800d9c1d3aa162a761fcbe7e31024c4338aff26c
Author: Iurii Gerzhedovich <ju...@gmail.com>
AuthorDate: Thu Jun 20 10:51:17 2024 +0300

    IGNITE-22462 Add planner test to verify type coercion for set operations like UNION, INTERSECT and EXCEPT
---
 .../planner/datatypes/BaseTypeCoercionTest.java    |  21 +-
 .../NumericComparisonTypeCoercionTest.java         | 128 ++---
 ...rcionTest.java => SetOperatorCoercionTest.java} | 612 +++++++++++----------
 .../sql/engine/planner/datatypes/utils/Types.java  |  12 +
 4 files changed, 424 insertions(+), 349 deletions(-)

diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/BaseTypeCoercionTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/BaseTypeCoercionTest.java
index 9d1ab8a56d..e94d967f93 100644
--- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/BaseTypeCoercionTest.java
+++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/BaseTypeCoercionTest.java
@@ -62,6 +62,21 @@ abstract class BaseTypeCoercionTest extends AbstractPlannerTest {
         );
     }
 
+    static IgniteSchema createSchemaWithTwoSingleColumnTable(NativeType c1, NativeType c2) {
+        return createSchema(
+                TestBuilders.table()
+                        .name("T1")
+                        .distribution(IgniteDistributions.single())
+                        .addColumn("C1", c1)
+                        .build(),
+                TestBuilders.table()
+                        .name("T2")
+                        .distribution(IgniteDistributions.single())
+                        .addColumn("C2", c2)
+                        .build()
+        );
+    }
+
     static Matcher<IgniteRel> operandMatcher(Matcher<RexNode> first, Matcher<RexNode> second) {
         return new BaseMatcher<>() {
             @Override
@@ -156,13 +171,13 @@ abstract class BaseTypeCoercionTest extends AbstractPlannerTest {
      */
     static class TestCaseBuilder {
         private final TypePair pair;
-        private Matcher<RexNode> firstOpMatcher;
+        private Matcher<?> firstOpMatcher;
 
         private TestCaseBuilder(TypePair pair) {
             this.pair = pair;
         }
 
-        TestCaseBuilder firstOpMatches(Matcher<RexNode> operandMatcher) {
+        TestCaseBuilder firstOpMatches(Matcher<?> operandMatcher) {
             firstOpMatcher = operandMatcher;
 
             return this;
@@ -174,7 +189,7 @@ abstract class BaseTypeCoercionTest extends AbstractPlannerTest {
             return this;
         }
 
-        Arguments secondOpMatches(Matcher<RexNode> operandMatcher) {
+        Arguments secondOpMatches(Matcher<?> operandMatcher) {
             return Arguments.of(pair, firstOpMatcher, operandMatcher);
         }
 
diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericComparisonTypeCoercionTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericComparisonTypeCoercionTest.java
index 19e2bf601f..25b246f3fe 100644
--- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericComparisonTypeCoercionTest.java
+++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericComparisonTypeCoercionTest.java
@@ -60,40 +60,40 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
                         .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT64)),
 
                 forTypePair(NumericPair.TINYINT_NUMBER_1)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(3)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(3))),
+                        .firstOpMatches(castTo(Types.NUMBER_3))
+                        .secondOpMatches(castTo(Types.NUMBER_3)),
 
                 forTypePair(NumericPair.TINYINT_NUMBER_2)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(3)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(3))),
+                        .firstOpMatches(castTo(Types.NUMBER_3))
+                        .secondOpMatches(castTo(Types.NUMBER_3)),
 
                 forTypePair(NumericPair.TINYINT_NUMBER_5)
                         .firstOpMatches(castTo(Types.NUMBER_5))
                         .secondOpMatches(ofTypeWithoutCast(Types.NUMBER_5)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_1_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(3, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(3, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_3_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_3_0)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_2_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(4, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(4, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_4_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_4_1)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_4_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(6, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(6, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_6_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_6_3)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_2_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(3, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(3, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_3_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_3_0)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_3_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(4, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(4, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_4_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_4_1)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_5_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(6, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(6, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_6_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_6_3)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_5_0))
@@ -194,52 +194,52 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
                         .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT64)),
 
                 forTypePair(NumericPair.INT_NUMBER_1)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(10)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(10))),
+                        .firstOpMatches(castTo(Types.NUMBER_10))
+                        .secondOpMatches(castTo(Types.NUMBER_10)),
 
                 forTypePair(NumericPair.INT_NUMBER_2)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(10)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(10))),
+                        .firstOpMatches(castTo(Types.NUMBER_10))
+                        .secondOpMatches(castTo(Types.NUMBER_10)),
 
                 forTypePair(NumericPair.INT_NUMBER_5)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(10)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(10))),
+                        .firstOpMatches(castTo(Types.NUMBER_10))
+                        .secondOpMatches(castTo(Types.NUMBER_10)),
 
                 forTypePair(NumericPair.INT_DECIMAL_1_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(10, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(10, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_10_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_10_0)),
 
                 forTypePair(NumericPair.INT_DECIMAL_2_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(11, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(11, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_11_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_11_1)),
 
                 forTypePair(NumericPair.INT_DECIMAL_4_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(13, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(13, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_13_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_13_3)),
 
                 forTypePair(NumericPair.INT_DECIMAL_2_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(10, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(10, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_10_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_10_0)),
 
                 forTypePair(NumericPair.INT_DECIMAL_3_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(11, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(11, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_11_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_11_1)),
 
                 forTypePair(NumericPair.INT_DECIMAL_5_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(13, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(13, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_13_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_13_3)),
 
                 forTypePair(NumericPair.INT_DECIMAL_5_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(10, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(10, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_10_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_10_0)),
 
                 forTypePair(NumericPair.INT_DECIMAL_6_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(11, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(11, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_11_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_11_1)),
 
                 forTypePair(NumericPair.INT_DECIMAL_8_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(13, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(13, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_13_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_13_3)),
 
                 forTypePair(NumericPair.INT_REAL)
                         .firstOpMatches(castTo(NativeTypes.FLOAT))
@@ -255,52 +255,52 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
                         .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT64)),
 
                 forTypePair(NumericPair.BIGINT_NUMBER_1)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(19)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(19))),
+                        .firstOpMatches(castTo(Types.NUMBER_19))
+                        .secondOpMatches(castTo(Types.NUMBER_19)),
 
                 forTypePair(NumericPair.BIGINT_NUMBER_2)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(19)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(19))),
+                        .firstOpMatches(castTo(Types.NUMBER_19))
+                        .secondOpMatches(castTo(Types.NUMBER_19)),
 
                 forTypePair(NumericPair.BIGINT_NUMBER_5)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(19)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(19))),
+                        .firstOpMatches(castTo(Types.NUMBER_19))
+                        .secondOpMatches(castTo(Types.NUMBER_19)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_1_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(19, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(19, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_19_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_19_0)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_2_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(20, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(20, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_20_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_20_1)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_4_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(22, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(22, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_22_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_22_3)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_2_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(19, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(19, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_19_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_19_0)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_3_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(20, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(20, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_20_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_20_1)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_5_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(22, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(22, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_22_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_22_3)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_5_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(19, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(19, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_19_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_19_0)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_6_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(20, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(20, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_20_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_20_1)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_8_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(22, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(22, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_22_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_22_3)),
 
                 forTypePair(NumericPair.BIGINT_REAL)
                         .firstOpMatches(castTo(NativeTypes.FLOAT))
diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericComparisonTypeCoercionTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/SetOperatorCoercionTest.java
similarity index 55%
copy from modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericComparisonTypeCoercionTest.java
copy to modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/SetOperatorCoercionTest.java
index 19e2bf601f..e883b3cdb6 100644
--- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericComparisonTypeCoercionTest.java
+++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/SetOperatorCoercionTest.java
@@ -17,17 +17,33 @@
 
 package org.apache.ignite.internal.sql.engine.planner.datatypes;
 
+import static org.apache.ignite.internal.lang.IgniteStringFormatter.format;
 import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
 
 import java.util.EnumSet;
 import java.util.List;
 import java.util.stream.Stream;
-import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.core.SetOp;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.rex.RexCall;
+import org.apache.calcite.sql.type.SqlTypeUtil;
 import org.apache.ignite.internal.sql.engine.planner.datatypes.utils.NumericPair;
 import org.apache.ignite.internal.sql.engine.planner.datatypes.utils.TypePair;
 import org.apache.ignite.internal.sql.engine.planner.datatypes.utils.Types;
+import org.apache.ignite.internal.sql.engine.rel.IgniteProject;
+import org.apache.ignite.internal.sql.engine.rel.IgniteRel;
+import org.apache.ignite.internal.sql.engine.rel.IgniteTableScan;
 import org.apache.ignite.internal.sql.engine.schema.IgniteSchema;
+import org.apache.ignite.internal.sql.engine.type.IgniteTypeFactory;
+import org.apache.ignite.internal.sql.engine.util.Commons;
+import org.apache.ignite.internal.sql.engine.util.TypeUtils;
+import org.apache.ignite.internal.type.NativeType;
 import org.apache.ignite.internal.type.NativeTypes;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
 import org.hamcrest.Matcher;
 import org.hamcrest.Matchers;
 import org.junit.jupiter.api.Test;
@@ -36,97 +52,155 @@ import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
 
 /**
- * A set of test to verify behavior of type coercion for binary comparison, when operands belongs to the NUMERIC type family.
+ * A set of test to verify behavior of type coercion for Set operations (UNION, INTERSECT and EXCEPT), when values belongs to the NUMERIC
+ * type family.
  *
- * <p>This tests aim to help to understand in which cases implicit cast will be added to which operand.
+ * <p>This tests aim to help to understand in which cases implicit cast will be added to which values.
  */
-public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
+public class SetOperatorCoercionTest extends BaseTypeCoercionTest {
+    @ParameterizedTest
+    @MethodSource("args")
+    public void unionOperator(
+            TypePair pair,
+            Matcher firstOperandMatcher,
+            Matcher secondOperandMatcher
+    ) throws Exception {
+        IgniteSchema schema = createSchemaWithTwoSingleColumnTable(pair.first(), pair.second());
+
+        assertPlan("SELECT c1 FROM t1 UNION ALL SELECT c2 from t2", schema,
+                setOperandsMatcher(firstOperandMatcher, secondOperandMatcher)::matches, List.of());
+        assertPlan("SELECT c2 FROM t2 UNION ALL SELECT c1 from t1", schema,
+                setOperandsMatcher(secondOperandMatcher, firstOperandMatcher)::matches, List.of());
+    }
+
+    @ParameterizedTest
+    @MethodSource("args")
+    public void exceptOperator(
+            TypePair pair,
+            Matcher firstOperandMatcher,
+            Matcher secondOperandMatcher
+    ) throws Exception {
+        IgniteSchema schema = createSchemaWithTwoSingleColumnTable(pair.first(), pair.second());
+
+        assertPlan("SELECT c1 FROM t1 EXCEPT SELECT c2 from t2", schema,
+                setOperandsMatcher(firstOperandMatcher, secondOperandMatcher)::matches, List.of());
+        assertPlan("SELECT c2 FROM t2 EXCEPT SELECT c1 from t1", schema,
+                setOperandsMatcher(secondOperandMatcher, firstOperandMatcher)::matches, List.of());
+    }
+
+    @ParameterizedTest
+    @MethodSource("args")
+    public void intersectOperator(
+            TypePair pair,
+            Matcher firstOperandMatcher,
+            Matcher secondOperandMatcher
+    ) throws Exception {
+        IgniteSchema schema = createSchemaWithTwoSingleColumnTable(pair.first(), pair.second());
+
+        assertPlan("SELECT c1 FROM t1 INTERSECT SELECT c2 from t2", schema,
+                setOperandsMatcher(firstOperandMatcher, secondOperandMatcher)::matches, List.of());
+        assertPlan("SELECT c2 FROM t2 INTERSECT SELECT c1 from t1", schema,
+                setOperandsMatcher(secondOperandMatcher, firstOperandMatcher)::matches, List.of());
+    }
+
+    /**
+     * This test ensures that {@link #args()} doesn't miss any type pair from {@link NumericPair}.
+     */
+    @Test
+    void argsIncludesAllTypePairs() {
+        EnumSet<NumericPair> remainingPairs = EnumSet.allOf(NumericPair.class);
+
+        args().map(Arguments::get).map(arg -> (NumericPair) arg[0]).forEach(remainingPairs::remove);
+
+        assertThat(remainingPairs, Matchers.empty());
+    }
+
+
     private static Stream<Arguments> args() {
         return Stream.of(
                 forTypePair(NumericPair.TINYINT_TINYINT)
-                        .firstOpMatches(ofTypeWithoutCast(NativeTypes.INT8))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT8)),
+                        .firstOpMatches(ofJustType(NativeTypes.INT8))
+                        .secondOpMatches(ofJustType(NativeTypes.INT8)),
 
                 forTypePair(NumericPair.TINYINT_SMALLINT)
                         .firstOpMatches(castTo(NativeTypes.INT16))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT16)),
+                        .secondOpMatches(ofJustType(NativeTypes.INT16)),
 
                 forTypePair(NumericPair.TINYINT_INT)
                         .firstOpMatches(castTo(NativeTypes.INT32))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT32)),
+                        .secondOpMatches(ofJustType(NativeTypes.INT32)),
 
                 forTypePair(NumericPair.TINYINT_BIGINT)
                         .firstOpMatches(castTo(NativeTypes.INT64))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT64)),
+                        .secondOpMatches(ofJustType(NativeTypes.INT64)),
 
                 forTypePair(NumericPair.TINYINT_NUMBER_1)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(3)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(3))),
+                        .firstOpMatches(castTo(Types.NUMBER_3))
+                        .secondOpMatches(castTo(Types.NUMBER_3)),
 
                 forTypePair(NumericPair.TINYINT_NUMBER_2)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(3)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(3))),
+                        .firstOpMatches(castTo(Types.NUMBER_3))
+                        .secondOpMatches(castTo(Types.NUMBER_3)),
 
                 forTypePair(NumericPair.TINYINT_NUMBER_5)
                         .firstOpMatches(castTo(Types.NUMBER_5))
-                        .secondOpMatches(ofTypeWithoutCast(Types.NUMBER_5)),
+                        .secondOpMatches(ofJustType(Types.NUMBER_5)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_1_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(3, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(3, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_3_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_3_0)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_2_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(4, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(4, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_4_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_4_1)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_4_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(6, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(6, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_6_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_6_3)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_2_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(3, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(3, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_3_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_3_0)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_3_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(4, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(4, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_4_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_4_1)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_5_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(6, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(6, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_6_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_6_3)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_5_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_0)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.TINYINT_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.TINYINT_REAL)
                         .firstOpMatches(castTo(NativeTypes.FLOAT))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.FLOAT)),
+                        .secondOpMatches(ofJustType(NativeTypes.FLOAT)),
 
                 forTypePair(NumericPair.TINYINT_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.SMALLINT_SMALLINT)
-                        .firstOpMatches(ofTypeWithoutCast(NativeTypes.INT16))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT16)),
+                        .firstOpMatches(ofJustType(NativeTypes.INT16))
+                        .secondOpMatches(ofJustType(NativeTypes.INT16)),
 
                 forTypePair(NumericPair.SMALLINT_INT)
                         .firstOpMatches(castTo(NativeTypes.INT32))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT32)),
+                        .secondOpMatches(ofJustType(NativeTypes.INT32)),
 
                 forTypePair(NumericPair.SMALLINT_BIGINT)
                         .firstOpMatches(castTo(NativeTypes.INT64))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT64)),
+                        .secondOpMatches(ofJustType(NativeTypes.INT64)),
 
                 forTypePair(NumericPair.SMALLINT_NUMBER_1)
                         .firstOpMatches(castTo(Types.NUMBER_5))
@@ -138,7 +212,7 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.SMALLINT_NUMBER_5)
                         .firstOpMatches(castTo(Types.NUMBER_5))
-                        .secondOpMatches(ofTypeWithoutCast(Types.NUMBER_5)),
+                        .secondOpMatches(ofJustType(Types.NUMBER_5)),
 
                 forTypePair(NumericPair.SMALLINT_DECIMAL_1_0)
                         .firstOpMatches(castTo(Types.DECIMAL_5_0))
@@ -166,198 +240,195 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.SMALLINT_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_5_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_0)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.SMALLINT_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.SMALLINT_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.SMALLINT_REAL)
                         .firstOpMatches(castTo(NativeTypes.FLOAT))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.FLOAT)),
+                        .secondOpMatches(ofJustType(NativeTypes.FLOAT)),
 
                 forTypePair(NumericPair.SMALLINT_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.INT_INT)
-                        .firstOpMatches(ofTypeWithoutCast(NativeTypes.INT32))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT32)),
+                        .firstOpMatches(ofJustType(NativeTypes.INT32))
+                        .secondOpMatches(ofJustType(NativeTypes.INT32)),
 
                 forTypePair(NumericPair.INT_BIGINT)
                         .firstOpMatches(castTo(NativeTypes.INT64))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT64)),
+                        .secondOpMatches(ofJustType(NativeTypes.INT64)),
 
                 forTypePair(NumericPair.INT_NUMBER_1)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(10)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(10))),
+                        .firstOpMatches(castTo(Types.NUMBER_10))
+                        .secondOpMatches(castTo(Types.NUMBER_10)),
 
                 forTypePair(NumericPair.INT_NUMBER_2)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(10)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(10))),
+                        .firstOpMatches(castTo(Types.NUMBER_10))
+                        .secondOpMatches(castTo(Types.NUMBER_10)),
 
                 forTypePair(NumericPair.INT_NUMBER_5)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(10)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(10))),
+                        .firstOpMatches(castTo(Types.NUMBER_10))
+                        .secondOpMatches(castTo(Types.NUMBER_10)),
 
                 forTypePair(NumericPair.INT_DECIMAL_1_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(10, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(10, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_10_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_10_0)),
 
                 forTypePair(NumericPair.INT_DECIMAL_2_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(11, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(11, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_11_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_11_1)),
 
                 forTypePair(NumericPair.INT_DECIMAL_4_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(13, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(13, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_13_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_13_3)),
 
                 forTypePair(NumericPair.INT_DECIMAL_2_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(10, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(10, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_10_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_10_0)),
 
                 forTypePair(NumericPair.INT_DECIMAL_3_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(11, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(11, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_11_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_11_1)),
 
                 forTypePair(NumericPair.INT_DECIMAL_5_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(13, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(13, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_13_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_13_3)),
 
                 forTypePair(NumericPair.INT_DECIMAL_5_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(10, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(10, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_10_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_10_0)),
 
                 forTypePair(NumericPair.INT_DECIMAL_6_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(11, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(11, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_11_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_11_1)),
 
                 forTypePair(NumericPair.INT_DECIMAL_8_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(13, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(13, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_13_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_13_3)),
 
                 forTypePair(NumericPair.INT_REAL)
                         .firstOpMatches(castTo(NativeTypes.FLOAT))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.FLOAT)),
+                        .secondOpMatches(ofJustType(NativeTypes.FLOAT)),
 
                 forTypePair(NumericPair.INT_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.BIGINT_BIGINT)
-                        .firstOpMatches(ofTypeWithoutCast(NativeTypes.INT64))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.INT64)),
+                        .firstOpMatches(ofJustType(NativeTypes.INT64))
+                        .secondOpMatches(ofJustType(NativeTypes.INT64)),
 
                 forTypePair(NumericPair.BIGINT_NUMBER_1)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(19)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(19))),
+                        .firstOpMatches(castTo(Types.NUMBER_19))
+                        .secondOpMatches(castTo(Types.NUMBER_19)),
 
                 forTypePair(NumericPair.BIGINT_NUMBER_2)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(19)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(19))),
+                        .firstOpMatches(castTo(Types.NUMBER_19))
+                        .secondOpMatches(castTo(Types.NUMBER_19)),
 
                 forTypePair(NumericPair.BIGINT_NUMBER_5)
-                        .firstOpMatches(castTo(NativeTypes.numberOf(19)))
-                        .secondOpMatches(castTo(NativeTypes.numberOf(19))),
+                        .firstOpMatches(castTo(Types.NUMBER_19))
+                        .secondOpMatches(castTo(Types.NUMBER_19)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_1_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(19, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(19, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_19_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_19_0)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_2_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(20, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(20, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_20_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_20_1)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_4_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(22, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(22, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_22_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_22_3)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_2_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(19, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(19, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_19_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_19_0)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_3_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(20, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(20, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_20_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_20_1)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_5_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(22, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(22, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_22_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_22_3)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_5_0)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(19, 0)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(19, 0))),
+                        .firstOpMatches(castTo(Types.DECIMAL_19_0))
+                        .secondOpMatches(castTo(Types.DECIMAL_19_0)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_6_1)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(20, 1)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(20, 1))),
+                        .firstOpMatches(castTo(Types.DECIMAL_20_1))
+                        .secondOpMatches(castTo(Types.DECIMAL_20_1)),
 
                 forTypePair(NumericPair.BIGINT_DECIMAL_8_3)
-                        .firstOpMatches(castTo(NativeTypes.decimalOf(22, 3)))
-                        .secondOpMatches(castTo(NativeTypes.decimalOf(22, 3))),
+                        .firstOpMatches(castTo(Types.DECIMAL_22_3))
+                        .secondOpMatches(castTo(Types.DECIMAL_22_3)),
 
                 forTypePair(NumericPair.BIGINT_REAL)
                         .firstOpMatches(castTo(NativeTypes.FLOAT))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.FLOAT)),
+                        .secondOpMatches(ofJustType(NativeTypes.FLOAT)),
 
                 forTypePair(NumericPair.BIGINT_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.NUMBER_1_NUMBER_1)
-                        .firstOpMatches(ofTypeWithoutCast(Types.NUMBER_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.NUMBER_1)),
+                        .firstOpMatches(ofJustType(Types.NUMBER_1))
+                        .secondOpMatches(ofJustType(Types.NUMBER_1)),
 
                 forTypePair(NumericPair.NUMBER_1_NUMBER_2)
                         .firstOpMatches(castTo(Types.NUMBER_2))
-                        .secondOpMatches(ofTypeWithoutCast(Types.NUMBER_2)),
+                        .secondOpMatches(ofJustType(Types.NUMBER_2)),
 
                 forTypePair(NumericPair.NUMBER_1_NUMBER_5)
                         .firstOpMatches(castTo(Types.NUMBER_5))
-                        .secondOpMatches(ofTypeWithoutCast(Types.NUMBER_5)),
+                        .secondOpMatches(ofJustType(Types.NUMBER_5)),
 
                 forTypePair(NumericPair.NUMBER_1_DECIMAL_1_0)
-                        .firstOpMatches(ofTypeWithoutCast(Types.NUMBER_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_1_0)),
+                        .firstOpMatches(ofJustType(Types.NUMBER_1))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_1_0)),
 
                 forTypePair(NumericPair.NUMBER_1_DECIMAL_2_1)
                         .firstOpMatches(castTo(Types.DECIMAL_2_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_2_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_2_1)),
 
                 forTypePair(NumericPair.NUMBER_1_DECIMAL_4_3)
                         .firstOpMatches(castTo(Types.DECIMAL_4_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_4_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_4_3)),
 
                 forTypePair(NumericPair.NUMBER_1_DECIMAL_2_0)
                         .firstOpMatches(castTo(Types.DECIMAL_2_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_2_0)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_2_0)),
 
                 forTypePair(NumericPair.NUMBER_1_DECIMAL_3_1)
                         .firstOpMatches(castTo(Types.DECIMAL_3_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_3_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_3_1)),
 
                 forTypePair(NumericPair.NUMBER_1_DECIMAL_5_3)
                         .firstOpMatches(castTo(Types.DECIMAL_5_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_3)),
 
                 forTypePair(NumericPair.NUMBER_1_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_5_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_0)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.NUMBER_1_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.NUMBER_1_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.NUMBER_1_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -365,19 +436,18 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.NUMBER_1_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.NUMBER_2_NUMBER_2)
-                        .firstOpMatches(ofTypeWithoutCast(Types.NUMBER_2))
-                        .secondOpMatches(ofTypeWithoutCast(Types.NUMBER_2)),
+                        .firstOpMatches(ofJustType(Types.NUMBER_2))
+                        .secondOpMatches(ofJustType(Types.NUMBER_2)),
 
                 forTypePair(NumericPair.NUMBER_2_NUMBER_5)
                         .firstOpMatches(castTo(Types.NUMBER_5))
-                        .secondOpMatches(ofTypeWithoutCast(Types.NUMBER_5)),
+                        .secondOpMatches(ofJustType(Types.NUMBER_5)),
 
                 forTypePair(NumericPair.NUMBER_2_DECIMAL_1_0)
-                        .firstOpMatches(ofTypeWithoutCast(Types.NUMBER_2))
+                        .firstOpMatches(ofJustType(Types.NUMBER_2))
                         .secondOpMatches(castTo(Types.DECIMAL_2_0)),
 
                 forTypePair(NumericPair.NUMBER_2_DECIMAL_2_1)
@@ -389,28 +459,28 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
                         .secondOpMatches(castTo(Types.DECIMAL_5_3)),
 
                 forTypePair(NumericPair.NUMBER_2_DECIMAL_2_0)
-                        .firstOpMatches(ofTypeWithoutCast(Types.NUMBER_2))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_2_0)),
+                        .firstOpMatches(ofJustType(Types.NUMBER_2))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_2_0)),
 
                 forTypePair(NumericPair.NUMBER_2_DECIMAL_3_1)
                         .firstOpMatches(castTo(Types.DECIMAL_3_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_3_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_3_1)),
 
                 forTypePair(NumericPair.NUMBER_2_DECIMAL_5_3)
                         .firstOpMatches(castTo(Types.DECIMAL_5_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_3)),
 
                 forTypePair(NumericPair.NUMBER_2_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_5_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_0)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.NUMBER_2_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.NUMBER_2_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.NUMBER_2_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -418,15 +488,14 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.NUMBER_2_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.NUMBER_5_NUMBER_5)
-                        .firstOpMatches(ofTypeWithoutCast(Types.NUMBER_5))
-                        .secondOpMatches(ofTypeWithoutCast(Types.NUMBER_5)),
+                        .firstOpMatches(ofJustType(Types.NUMBER_5))
+                        .secondOpMatches(ofJustType(Types.NUMBER_5)),
 
                 forTypePair(NumericPair.NUMBER_5_DECIMAL_1_0)
-                        .firstOpMatches(ofTypeWithoutCast(Types.NUMBER_5))
+                        .firstOpMatches(ofJustType(Types.NUMBER_5))
                         .secondOpMatches(castTo(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.NUMBER_5_DECIMAL_2_1)
@@ -438,7 +507,7 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
                         .secondOpMatches(castTo(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.NUMBER_5_DECIMAL_2_0)
-                        .firstOpMatches(ofTypeWithoutCast(Types.NUMBER_5))
+                        .firstOpMatches(ofJustType(Types.NUMBER_5))
                         .secondOpMatches(castTo(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.NUMBER_5_DECIMAL_3_1)
@@ -450,16 +519,16 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
                         .secondOpMatches(castTo(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.NUMBER_5_DECIMAL_5_0)
-                        .firstOpMatches(ofTypeWithoutCast(Types.NUMBER_5))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_0)),
+                        .firstOpMatches(ofJustType(Types.NUMBER_5))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.NUMBER_5_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.NUMBER_5_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.NUMBER_5_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -467,44 +536,43 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.NUMBER_5_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_1_0)
-                        .firstOpMatches(ofTypeWithoutCast(Types.DECIMAL_1_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_1_0)),
+                        .firstOpMatches(ofJustType(Types.DECIMAL_1_0))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_1_0)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_2_1)
                         .firstOpMatches(castTo(Types.DECIMAL_2_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_2_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_2_1)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_4_3)
                         .firstOpMatches(castTo(Types.DECIMAL_4_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_4_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_4_3)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_2_0)
                         .firstOpMatches(castTo(Types.DECIMAL_2_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_2_0)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_2_0)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_3_1)
                         .firstOpMatches(castTo(Types.DECIMAL_3_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_3_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_3_1)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_5_3)
                         .firstOpMatches(castTo(Types.DECIMAL_5_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_3)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_5_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_0)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.DECIMAL_1_0_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -512,16 +580,15 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_1_0_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_2_1)
-                        .firstOpMatches(ofTypeWithoutCast(Types.DECIMAL_2_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_2_1)),
+                        .firstOpMatches(ofJustType(Types.DECIMAL_2_1))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_2_1)),
 
                 forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_4_3)
                         .firstOpMatches(castTo(Types.DECIMAL_4_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_4_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_4_3)),
 
                 forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_2_0)
                         .firstOpMatches(castTo(Types.DECIMAL_3_1))
@@ -529,11 +596,11 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_3_1)
                         .firstOpMatches(castTo(Types.DECIMAL_3_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_3_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_3_1)),
 
                 forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_5_3)
                         .firstOpMatches(castTo(Types.DECIMAL_5_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_3)),
 
                 forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
@@ -541,11 +608,11 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.DECIMAL_2_1_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -553,12 +620,11 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_2_1_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_4_3)
-                        .firstOpMatches(ofTypeWithoutCast(Types.DECIMAL_4_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_4_3)),
+                        .firstOpMatches(ofJustType(Types.DECIMAL_4_3))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_4_3)),
 
                 forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_2_0)
                         .firstOpMatches(castTo(Types.DECIMAL_5_3))
@@ -570,7 +636,7 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_5_3)
                         .firstOpMatches(castTo(Types.DECIMAL_5_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_3)),
 
                 forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
@@ -582,7 +648,7 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.DECIMAL_4_3_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -590,32 +656,31 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_4_3_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_2_0)
-                        .firstOpMatches(ofTypeWithoutCast(Types.DECIMAL_2_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_2_0)),
+                        .firstOpMatches(ofJustType(Types.DECIMAL_2_0))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_2_0)),
 
                 forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_3_1)
                         .firstOpMatches(castTo(Types.DECIMAL_3_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_3_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_3_1)),
 
                 forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_5_3)
                         .firstOpMatches(castTo(Types.DECIMAL_5_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_3)),
 
                 forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_5_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_0)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.DECIMAL_2_0_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -623,16 +688,15 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_2_0_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_3_1)
-                        .firstOpMatches(ofTypeWithoutCast(Types.DECIMAL_3_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_3_1)),
+                        .firstOpMatches(ofJustType(Types.DECIMAL_3_1))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_3_1)),
 
                 forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_5_3)
                         .firstOpMatches(castTo(Types.DECIMAL_5_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_3)),
 
                 forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
@@ -640,11 +704,11 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.DECIMAL_3_1_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -652,12 +716,11 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_3_1_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DECIMAL_5_3_DECIMAL_5_3)
-                        .firstOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_3)),
+                        .firstOpMatches(ofJustType(Types.DECIMAL_5_3))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_3)),
 
                 forTypePair(NumericPair.DECIMAL_5_3_DECIMAL_5_0)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
@@ -669,7 +732,7 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_5_3_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.DECIMAL_5_3_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -677,20 +740,19 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_5_3_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DECIMAL_5_0_DECIMAL_5_0)
-                        .firstOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_0))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_5_0)),
+                        .firstOpMatches(ofJustType(Types.DECIMAL_5_0))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_5_0)),
 
                 forTypePair(NumericPair.DECIMAL_5_0_DECIMAL_6_1)
                         .firstOpMatches(castTo(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.DECIMAL_5_0_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.DECIMAL_5_0_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -698,16 +760,15 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_5_0_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DECIMAL_6_1_DECIMAL_6_1)
-                        .firstOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_6_1)),
+                        .firstOpMatches(ofJustType(Types.DECIMAL_6_1))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_6_1)),
 
                 forTypePair(NumericPair.DECIMAL_6_1_DECIMAL_8_3)
                         .firstOpMatches(castTo(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.DECIMAL_6_1_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -715,12 +776,11 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_6_1_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DECIMAL_8_3_DECIMAL_8_3)
-                        .firstOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3))
-                        .secondOpMatches(ofTypeWithoutCast(Types.DECIMAL_8_3)),
+                        .firstOpMatches(ofJustType(Types.DECIMAL_8_3))
+                        .secondOpMatches(ofJustType(Types.DECIMAL_8_3)),
 
                 forTypePair(NumericPair.DECIMAL_8_3_REAL)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
@@ -728,98 +788,86 @@ public class NumericComparisonTypeCoercionTest extends BaseTypeCoercionTest {
 
                 forTypePair(NumericPair.DECIMAL_8_3_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.REAL_REAL)
-                        .firstOpMatches(ofTypeWithoutCast(NativeTypes.FLOAT))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.FLOAT)),
+                        .firstOpMatches(ofJustType(NativeTypes.FLOAT))
+                        .secondOpMatches(ofJustType(NativeTypes.FLOAT)),
 
                 forTypePair(NumericPair.REAL_DOUBLE)
                         .firstOpMatches(castTo(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE)),
-
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE)),
 
                 forTypePair(NumericPair.DOUBLE_DOUBLE)
-                        .firstOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE))
-                        .secondOpMatches(ofTypeWithoutCast(NativeTypes.DOUBLE))
+                        .firstOpMatches(ofJustType(NativeTypes.DOUBLE))
+                        .secondOpMatches(ofJustType(NativeTypes.DOUBLE))
         );
     }
 
-    @ParameterizedTest
-    @MethodSource("args")
-    public void equalsTo(
-            TypePair typePair,
-            Matcher<RexNode> firstOperandMatcher,
-            Matcher<RexNode> secondOperandMatcher
-    ) throws Exception {
-        IgniteSchema schema = createSchemaWithTwoColumnTable(typePair.first(), typePair.second());
-
-        assertPlan("SELECT c1 = c2 FROM t", schema, operandMatcher(firstOperandMatcher, secondOperandMatcher)::matches, List.of());
-        assertPlan("SELECT c2 = c1 FROM t", schema, operandMatcher(secondOperandMatcher, firstOperandMatcher)::matches, List.of());
-    }
-
-    @ParameterizedTest
-    @MethodSource("args")
-    public void lessThan(
-            TypePair typePair,
-            Matcher<RexNode> firstOperandMatcher,
-            Matcher<RexNode> secondOperandMatcher
-    ) throws Exception {
-        IgniteSchema schema = createSchemaWithTwoColumnTable(typePair.first(), typePair.second());
-
-        assertPlan("SELECT c1 < c2 FROM t", schema, operandMatcher(firstOperandMatcher, secondOperandMatcher)::matches, List.of());
-        assertPlan("SELECT c2 > c1 FROM t", schema, operandMatcher(secondOperandMatcher, firstOperandMatcher)::matches, List.of());
-    }
-
-    @ParameterizedTest
-    @MethodSource("args")
-    public void lessThanOrEqual(
-            TypePair typePair,
-            Matcher<RexNode> firstOperandMatcher,
-            Matcher<RexNode> secondOperandMatcher
-    ) throws Exception {
-        IgniteSchema schema = createSchemaWithTwoColumnTable(typePair.first(), typePair.second());
-
-        assertPlan("SELECT c1 <= c2 FROM t", schema, operandMatcher(firstOperandMatcher, secondOperandMatcher)::matches, List.of());
-        assertPlan("SELECT c2 >= c1 FROM t", schema, operandMatcher(secondOperandMatcher, firstOperandMatcher)::matches, List.of());
-    }
-
-    @ParameterizedTest
-    @MethodSource("args")
-    public void greaterThan(
-            TypePair typePair,
-            Matcher<RexNode> firstOperandMatcher,
-            Matcher<RexNode> secondOperandMatcher
-    ) throws Exception {
-        IgniteSchema schema = createSchemaWithTwoColumnTable(typePair.first(), typePair.second());
-
-        assertPlan("SELECT c1 > c2 FROM t", schema, operandMatcher(firstOperandMatcher, secondOperandMatcher)::matches, List.of());
-        assertPlan("SELECT c2 < c1 FROM t", schema, operandMatcher(secondOperandMatcher, firstOperandMatcher)::matches, List.of());
-    }
-
-    @ParameterizedTest
-    @MethodSource("args")
-    public void greaterThanOrEqual(
-            TypePair typePair,
-            Matcher<RexNode> firstOperandMatcher,
-            Matcher<RexNode> secondOperandMatcher
-    ) throws Exception {
-        IgniteSchema schema = createSchemaWithTwoColumnTable(typePair.first(), typePair.second());
-
-        assertPlan("SELECT c1 <= c2 FROM t", schema, operandMatcher(firstOperandMatcher, secondOperandMatcher)::matches, List.of());
-        assertPlan("SELECT c2 >= c1 FROM t", schema, operandMatcher(secondOperandMatcher, firstOperandMatcher)::matches, List.of());
-    }
-
     /**
-     * This test ensures that {@link #args()} doesn't miss any type pair from {@link NumericPair}.
+     * Creates a matcher to verify that given relDataType has expected type.
+     *
+     * @param type Expected return type.
+     * @return A matcher.
      */
-    @Test
-    void argsIncludesAllTypePairs() {
-        EnumSet<NumericPair> remainingPairs = EnumSet.allOf(NumericPair.class);
-
-        args().map(Arguments::get).map(arg -> (NumericPair) arg[0]).forEach(remainingPairs::remove);
+    static Matcher<RelDataTypeField> ofJustType(NativeType type) {
+        IgniteTypeFactory typeFactory = Commons.typeFactory();
+        RelDataType sqlType = TypeUtils.native2relationalType(typeFactory, type);
+
+        return new BaseMatcher<>() {
+            @Override
+            public boolean matches(Object actual) {
+                return SqlTypeUtil.equalSansNullability(typeFactory, ((RelDataTypeField) actual).getType(), sqlType);
+            }
+
+            @Override
+            public void describeMismatch(Object item, Description description) {
+                description.appendText("was ").appendValue(item).appendText(" of type " + ((RelDataTypeField) item).getType());
+            }
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText(format("Operand of type {}", sqlType));
+            }
+        };
+    }
 
-        assertThat(remainingPairs, Matchers.empty());
+    static Matcher<IgniteRel> setOperandsMatcher(Matcher<Object> first, Matcher<Object> second) {
+        return new BaseMatcher<>() {
+            @Override
+            public boolean matches(Object actual) {
+                assertThat(actual, instanceOf(SetOp.class));
+                SetOp setOperation = ((SetOp) actual);
+
+                RelNode left = setOperation.getInputs().get(0);
+                RelNode right = setOperation.getInputs().get(1);
+
+                Object leftOp = getOperand(left);
+                Object rightOp = getOperand(right);
+
+                assertThat(leftOp, first);
+                assertThat(rightOp, second);
+
+                return true;
+            }
+
+            private Object getOperand(RelNode left) {
+                Object result = null;
+                if (left instanceof IgniteProject) {
+                    result = ((IgniteProject) left).getProjects().get(0);
+                    assertThat(result, instanceOf(RexCall.class));
+                }
+                if (left instanceof IgniteTableScan) {
+                    result = left.getRowType().getFieldList().get(0);
+                    assertThat(result, instanceOf(RelDataTypeField.class));
+                }
+                return result;
+            }
+
+            @Override
+            public void describeTo(Description description) {
+
+            }
+        };
     }
 }
diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/utils/Types.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/utils/Types.java
index 5ad15f5093..b2a4867095 100644
--- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/utils/Types.java
+++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/utils/Types.java
@@ -28,16 +28,28 @@ import org.apache.ignite.internal.type.NativeTypes;
 public final class Types {
     public static final NativeType NUMBER_1 = NativeTypes.numberOf(1);
     public static final NativeType NUMBER_2 = NativeTypes.numberOf(2);
+    public static final NativeType NUMBER_3 = NativeTypes.numberOf(3);
     public static final NativeType NUMBER_5 = NativeTypes.numberOf(5);
+    public static final NativeType NUMBER_10 = NativeTypes.numberOf(10);
+    public static final NativeType NUMBER_19 = NativeTypes.numberOf(19);
 
     public static final NativeType DECIMAL_1_0 = NativeTypes.decimalOf(1, 0);
     public static final NativeType DECIMAL_2_1 = NativeTypes.decimalOf(2, 1);
+    public static final NativeType DECIMAL_4_1 = NativeTypes.decimalOf(4, 1);
     public static final NativeType DECIMAL_4_3 = NativeTypes.decimalOf(4, 3);
+    public static final NativeType DECIMAL_10_0 = NativeTypes.decimalOf(10, 0);
+    public static final NativeType DECIMAL_11_1 = NativeTypes.decimalOf(11, 1);
+    public static final NativeType DECIMAL_13_3 = NativeTypes.decimalOf(13, 3);
+    public static final NativeType DECIMAL_19_0 = NativeTypes.decimalOf(19, 0);
+    public static final NativeType DECIMAL_20_1 = NativeTypes.decimalOf(20, 1);
+    public static final NativeType DECIMAL_22_3 = NativeTypes.decimalOf(22, 3);
 
     public static final NativeType DECIMAL_2_0 = NativeTypes.decimalOf(2, 0);
     public static final NativeType DECIMAL_3_1 = NativeTypes.decimalOf(3, 1);
     public static final NativeType DECIMAL_5_3 = NativeTypes.decimalOf(5, 3);
+    public static final NativeType DECIMAL_6_3 = NativeTypes.decimalOf(6, 3);
 
+    public static final NativeType DECIMAL_3_0 = NativeTypes.decimalOf(3, 0);
     public static final NativeType DECIMAL_5_0 = NativeTypes.decimalOf(5, 0);
     public static final NativeType DECIMAL_6_1 = NativeTypes.decimalOf(6, 1);
     public static final NativeType DECIMAL_8_3 = NativeTypes.decimalOf(8, 3);