diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs b/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs index 251b20a4475..a53af4274f2 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs @@ -528,7 +528,7 @@ public async Task TestCustomDecimalScale() [Test] public async Task TestMaxDecimalScale() { - await using var resultSet = await Client.Sql.ExecuteAsync(null, "select (10 / ?)", 3m); + await using var resultSet = await Client.Sql.ExecuteAsync(null, "select (10 / ?::decimal)", 3m); IIgniteTuple res = await resultSet.SingleAsync(); var bigDecimal = (BigDecimal)res[0]!; 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 e96df8bd17b..5066bf2e437 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 @@ -416,11 +416,11 @@ public void testFunctionArgsToNumericImplicitConversion() { assertQuery("select decode(?, 0, 0, 1, 1.0)").withParams(0).returns(new BigDecimal("0.0")).check(); assertQuery("select decode(?, 0, 0, 1, 1.0)").withParams(1).returns(new BigDecimal("1.0")).check(); assertQuery("select decode(1, 0, 0, ?, 1.0)").withParams(1).returns(new BigDecimal("1.0")).check(); - assertQuery("select decode(1, 0, 0, 1, ?)").withParams(new BigDecimal("1.0")).returns(new BigDecimal("1.0")).check(); + assertQuery("select decode(1, 0, 0, 1, ?)").withParams(new BigDecimal("1.0")).returns(new BigDecimal("1.000000")).check(); assertQuery("select decode(?, 0, 0, 1, 1.000)").withParams(0).returns(new BigDecimal("0.000")).check(); assertQuery("select decode(?, 0, 0, 1, 1.000)").withParams(1).returns(new BigDecimal("1.000")).check(); assertQuery("select decode(1, 0, 0, ?, 1.000)").withParams(1).returns(new BigDecimal("1.000")).check(); - assertQuery("select decode(1, 0, 0, 1, ?)").withParams(new BigDecimal("1.00")).returns(new BigDecimal("1.00")).check(); + assertQuery("select decode(1, 0, 0, 1, ?)").withParams(new BigDecimal("1.00")).returns(new BigDecimal("1.000000")).check(); assertQuery("select decode(?, 0, 0.0, 1, 1.000)").withParams(0).returns(new BigDecimal("0.000")).check(); assertQuery("select decode(?, 0, 0.000, 1, 1.0)").withParams(1).returns(new BigDecimal("1.000")).check(); assertQuery("select decode(?, 0, 1.0, 1, 1, 5)").withParams(3).returns(new BigDecimal("5.0")).check(); diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDynamicParameterTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDynamicParameterTest.java index aa27e4eb550..d538c461cc5 100644 --- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDynamicParameterTest.java +++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDynamicParameterTest.java @@ -18,6 +18,8 @@ package org.apache.ignite.internal.sql.engine; import static org.apache.ignite.internal.lang.IgniteStringFormatter.format; +import static org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_PRECISION; +import static org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_SCALE; import static org.apache.ignite.internal.sql.engine.util.SqlTestUtils.assertThrowsSqlException; import static org.apache.ignite.internal.testframework.IgniteTestUtils.await; import static org.apache.ignite.lang.ErrorGroups.Sql.RUNTIME_ERR; @@ -35,6 +37,7 @@ import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.sql.type.SqlTypeName; import org.apache.ignite.internal.sql.BaseSqlIntegrationTest; +import org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator; import org.apache.ignite.internal.sql.engine.prepare.ParameterType; import org.apache.ignite.internal.sql.engine.property.SqlProperties; import org.apache.ignite.internal.sql.engine.property.SqlPropertiesHelper; @@ -56,6 +59,7 @@ import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.EnumSource.Mode; import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; /** Dynamic parameters checks. */ public class ItDynamicParameterTest extends BaseSqlIntegrationTest { @@ -81,9 +85,12 @@ void testMetadataTypesForDynamicParameters(ColumnType type) { // TODO https://issues.apache.org/jira/browse/IGNITE-19162 Ignite SQL doesn't support precision more than 3 for temporal types. if (type == ColumnType.TIME || type == ColumnType.TIMESTAMP || type == ColumnType.DATETIME) { param = SqlTestUtils.generateValueByType(type, 3, -1); + } else if (type == ColumnType.DECIMAL) { + param = SqlTestUtils.generateValueByType(type, DECIMAL_DYNAMIC_PARAM_PRECISION, DECIMAL_DYNAMIC_PARAM_SCALE); } else { param = SqlTestUtils.generateValueByTypeWithMaxScalePrecisionForSql(type); } + List> ret = sql("SELECT typeof(?)", param); String type0 = (String) ret.get(0).get(0); @@ -92,6 +99,46 @@ void testMetadataTypesForDynamicParameters(ColumnType type) { assertQuery("SELECT ?").withParams(param).returns(param).columnMetadata(new MetadataMatcher().type(type)).check(); } + /** + * By default derived type of parameter of type BigDecimal is DECIMAL({@value IgniteSqlValidator#DECIMAL_DYNAMIC_PARAM_PRECISION}, + * {@value IgniteSqlValidator#DECIMAL_DYNAMIC_PARAM_SCALE}). This test makes sure it's possible to go beyond default precision and scale + * by wrapping dynamic param placeholder with CAST operation. + */ + @ParameterizedTest + @ValueSource(ints = {10, 20, 30, 60, 120}) + void testMetadataTypesForDecimalDynamicParameters(int precision) { + int scale = precision / 2; + Object param = SqlTestUtils.generateValueByType(ColumnType.DECIMAL, precision, scale); + + String typeString = decimalTypeString(precision, scale); + + assertQuery("SELECT typeof(CAST(? as " + typeString + "))") + .withParams(param) + .returns(typeString) + .check(); + + assertQuery("SELECT typeof(?::" + typeString + ")") + .withParams(param) + .returns(typeString) + .check(); + + assertQuery("SELECT CAST(? as " + typeString + ")") + .withParams(param) + .columnMetadata(new MetadataMatcher().type(ColumnType.DECIMAL).precision(precision).scale(scale)) + .returns(param) + .check(); + + assertQuery("SELECT ?::" + typeString) + .withParams(param) + .columnMetadata(new MetadataMatcher().type(ColumnType.DECIMAL).precision(precision).scale(scale)) + .returns(param) + .check(); + } + + private static String decimalTypeString(int precision, int scale) { + return format("DECIMAL({}, {})", precision, scale); + } + @Test public void testDynamicParameters() { assertQuery("SELECT COALESCE(null, ?)").withParams(13).returns(13).check(); diff --git a/modules/sql-engine/src/integrationTest/sql/cast/test_cast_decimal.test b/modules/sql-engine/src/integrationTest/sql/cast/test_cast_decimal.test index 919a9cbfce6..a28dbf3b325 100644 --- a/modules/sql-engine/src/integrationTest/sql/cast/test_cast_decimal.test +++ b/modules/sql-engine/src/integrationTest/sql/cast/test_cast_decimal.test @@ -30,6 +30,12 @@ SELECT 0.3::DECIMAL(3, 5); statement error: Numeric field overflow. A field with precision 3, scale 3 must round to an absolute value less than 1. SELECT -1::DECIMAL(3, 3); +statement error: Numeric field overflow. A field with precision 3, scale 3 must round to an absolute value less than 1. +SELECT 1::DECIMAL(3, 3); + +statement error: Numeric field overflow. A field with precision 32767, scale 32767 must round to an absolute value less than 1. +SELECT 1::DECIMAL(32767, 32767); + # the first cast produces must report an error statement error: Numeric field overflow. A field with precision 3, scale 0 must round to an absolute value less than 10^3. SELECT 9999999::DECIMAL(3)::DECIMAL(4, 2); @@ -60,22 +66,22 @@ SELECT CAST(${val} AS DECIMAL); query T SELECT CAST(100.1::DECIMAL(4, 1) AS DECIMAL); ---- -100.1 +100 query T SELECT CAST(100.1::REAL AS DECIMAL); ---- -100.1 +100 query T SELECT CAST(100.1::FLOAT AS DECIMAL); ---- -100.1 +100 query T SELECT CAST(100.1::DOUBLE AS DECIMAL); ---- -100.1 +100 query T SELECT CAST(100.1234::DOUBLE AS DECIMAL(7, 2)); diff --git a/modules/sql-engine/src/integrationTest/sql/types/decimal/cast_to_decimal.test b/modules/sql-engine/src/integrationTest/sql/types/decimal/cast_to_decimal.test index 5cdf862b7c1..651d75dd285 100644 --- a/modules/sql-engine/src/integrationTest/sql/types/decimal/cast_to_decimal.test +++ b/modules/sql-engine/src/integrationTest/sql/types/decimal/cast_to_decimal.test @@ -237,10 +237,10 @@ statement error SELECT 17014118346046923173168730371588410572::DOUBLE::DECIMAL(4,0) # decimal -query RRR -SELECT 0.01::DECIMAL * 10, 0.01::DECIMAL(10,1) * 10, 0.01::DECIMAL(10,3) * 10 +query RRRR +SELECT 0.01::DECIMAL * 10, 0.01::DECIMAL(3,2) * 10, 0.01::DECIMAL(10,1) * 10, 0.01::DECIMAL(10,3) * 10 ---- -0.10 0.0 0.100 +0 0.10 0.0 0.100 query R SELECT 10::INTEGER::DECIMAL(10,3) diff --git a/modules/sql-engine/src/integrationTest/sql/types/decimal/decimal_arithmetic.test b/modules/sql-engine/src/integrationTest/sql/types/decimal/decimal_arithmetic.test index e3db6605d71..331f14cdf00 100644 --- a/modules/sql-engine/src/integrationTest/sql/types/decimal/decimal_arithmetic.test +++ b/modules/sql-engine/src/integrationTest/sql/types/decimal/decimal_arithmetic.test @@ -7,25 +7,25 @@ PRAGMA enable_verification # negate query II -SELECT -('0.1'::DECIMAL), -('-0.1'::DECIMAL) +SELECT -('0.1'::DECIMAL(2,1)), -('-0.1'::DECIMAL(2,1)) ---- -0.1 0.1 # unary + query II -SELECT +('0.1'::DECIMAL), +('-0.1'::DECIMAL) +SELECT +('0.1'::DECIMAL(2,1)), +('-0.1'::DECIMAL(2,1)) ---- 0.1 -0.1 # addition query I -SELECT '0.1'::DECIMAL + '0.1'::DECIMAL +SELECT '0.1'::DECIMAL(2,1) + '0.1'::DECIMAL(2,1) ---- 0.2 # addition with non-decimal query I -SELECT '0.1'::DECIMAL + 1::INTEGER +SELECT '0.1'::DECIMAL(2,1) + 1::INTEGER ---- 1.1 @@ -107,14 +107,14 @@ statement ok INSERT INTO decimals VALUES (decimal '0.1'), (decimal '0.2'); query II -SELECT d + '0.1'::DECIMAL, d + 10000 FROM decimals ORDER BY d; +SELECT d + '0.1'::DECIMAL(2,1), d + 10000 FROM decimals ORDER BY d; ---- 0.2 10000.1 0.3 10000.2 # multiplication query I -SELECT '0.1'::DECIMAL * '10.0'::DECIMAL +SELECT '0.1'::DECIMAL(2,1) * '10.0'::DECIMAL(3,1) ---- 1.0 @@ -124,13 +124,13 @@ SELECT typeof('0.1'::DECIMAL(2,1) * '10.0'::DECIMAL(3,1)) DECIMAL(5, 2) query I -SELECT '0.1'::DECIMAL * '0.1'::DECIMAL +SELECT '0.1'::DECIMAL(2,1) * '0.1'::DECIMAL(2,1) ---- 0.01 # multiplication with non-decimal query I -SELECT '0.1'::DECIMAL * 10::INTEGER +SELECT '0.1'::DECIMAL(2,1) * 10::INTEGER ---- 1.0 @@ -154,10 +154,10 @@ SELECT ('18.25'::DECIMAL(4,2) * '17.25'::DECIMAL(4,2))::VARCHAR # different types query IIII -SELECT '0.001'::DECIMAL * 100::TINYINT, - '0.001'::DECIMAL * 10000::SMALLINT, - '0.001'::DECIMAL * 1000000::INTEGER, - '0.001'::DECIMAL * 100000000::BIGINT +SELECT '0.001'::DECIMAL(4,3) * 100::TINYINT, + '0.001'::DECIMAL(4,3) * 10000::SMALLINT, + '0.001'::DECIMAL(4,3) * 1000000::INTEGER, + '0.001'::DECIMAL(4,3) * 100000000::BIGINT ---- 0.100 10.000 diff --git a/modules/sql-engine/src/integrationTest/sql/types/decimal/test_decimal.test b/modules/sql-engine/src/integrationTest/sql/types/decimal/test_decimal.test index 9d603b5eeb8..9d4f9b6f2d8 100644 --- a/modules/sql-engine/src/integrationTest/sql/types/decimal/test_decimal.test +++ b/modules/sql-engine/src/integrationTest/sql/types/decimal/test_decimal.test @@ -13,31 +13,31 @@ DECIMAL(32767, 0) # test basic string conversions query II -SELECT '0.1'::DECIMAL::VARCHAR, '922337203685478.758'::DECIMAL::VARCHAR; +SELECT '0.1'::DECIMAL(2,1)::VARCHAR, '922337203685478.758'::DECIMAL(18,3)::VARCHAR; ---- 0.1 922337203685478.758 # negative values query II -SELECT '-0.1'::DECIMAL::VARCHAR, '-922337203685478.758'::DECIMAL::VARCHAR; +SELECT '-0.1'::DECIMAL(2,1)::VARCHAR, '-922337203685478.758'::DECIMAL(18,3)::VARCHAR; ---- -0.1 -922337203685478.758 # some more difficult string conversions query III -SELECT ' 7 '::DECIMAL::VARCHAR, '9.'::DECIMAL::VARCHAR, '.1'::DECIMAL::VARCHAR; +SELECT ' 7 '::DECIMAL::VARCHAR, '9.'::DECIMAL::VARCHAR, '.1'::DECIMAL(2,1)::VARCHAR; ---- 7 9 0.1 # trailing decimals get truncated query II -SELECT '0.123456789'::DECIMAL::VARCHAR, '-0.123456789'::DECIMAL::VARCHAR; +SELECT '0.123456789'::DECIMAL(10,9)::VARCHAR, '-0.123456789'::DECIMAL(10,9)::VARCHAR; ---- 0.123456789 -0.123456789 # no overflow in conversion query I -SELECT '9223372036854788.758'::DECIMAL; +SELECT '9223372036854788.758'::DECIMAL(19,3); ---- 9223372036854788.758 @@ -68,7 +68,7 @@ SELECT '-1'::DECIMAL(3, 3)::VARCHAR; # repeat the same cast many times query I -select '0.1'::decimal::decimal::decimal; +select '0.1'::decimal(2,1)::decimal(2,1)::decimal(2,1); ---- 0.1 @@ -120,7 +120,7 @@ SELECT '100.100'::DECIMAL(10,0)::VARCHAR 100 query R -SELECT '100.100'::DECIMAL::VARCHAR +SELECT '100.100'::DECIMAL(6,3)::VARCHAR ---- 100.100 diff --git a/modules/sql-engine/src/integrationTest/sql/types/decimal/test_decimal_ops.test b/modules/sql-engine/src/integrationTest/sql/types/decimal/test_decimal_ops.test index 0c910eba281..3be90d3282a 100644 --- a/modules/sql-engine/src/integrationTest/sql/types/decimal/test_decimal_ops.test +++ b/modules/sql-engine/src/integrationTest/sql/types/decimal/test_decimal_ops.test @@ -104,7 +104,7 @@ DELETE FROM decimals WHERE d <> d::DECIMAL(9,1) # # test ABS function query III -SELECT ABS('-0.1'::DECIMAL), ABS('0.1'::DECIMAL), ABS(NULL::DECIMAL) +SELECT ABS('-0.1'::DECIMAL(2,1)), ABS('0.1'::DECIMAL(2,1)), ABS(NULL::DECIMAL) ---- 0.1 0.1 NULL @@ -115,17 +115,17 @@ SELECT ABS('-0.1'::DECIMAL(4,3)), ABS('-0.1'::DECIMAL(9,3)), ABS('-0.1'::DECIMAL # test CEIL function query III -SELECT CEIL('0.1'::DECIMAL), CEIL('-0.1'::DECIMAL), CEIL(NULL::DECIMAL) +SELECT CEIL('0.1'::DECIMAL(2,1)), CEIL('-0.1'::DECIMAL(2,1)), CEIL(NULL::DECIMAL) ---- 1 0 NULL query II -SELECT CEIL('100.3'::DECIMAL), CEIL('-127012.3'::DECIMAL) +SELECT CEIL('100.3'::DECIMAL(4,1)), CEIL('-127012.3'::DECIMAL(7,1)) ---- 101 -127012 query II -SELECT CEIL('10.5'::DECIMAL), CEIL('-10.5'::DECIMAL) +SELECT CEIL('10.5'::DECIMAL(3,1)), CEIL('-10.5'::DECIMAL(3,1)) ---- 11 -10 @@ -142,17 +142,17 @@ SELECT CEIL('-999.9'::DECIMAL(4,1)), CEIL('-99999999.9'::DECIMAL(9,1)), CEIL('-9 # test FLOOR function query III -SELECT FLOOR('0.1'::DECIMAL), FLOOR('-0.1'::DECIMAL), FLOOR(NULL::DECIMAL) +SELECT FLOOR(decimal '0.1'), FLOOR(decimal '-0.1'), FLOOR(NULL::DECIMAL) ---- 0 -1 NULL query II -SELECT FLOOR('100.3'::DECIMAL), FLOOR('-127012.3'::DECIMAL) +SELECT FLOOR(decimal '100.3'), FLOOR(decimal '-127012.3') ---- 100 -127013 query II -SELECT FLOOR('10.5'::DECIMAL), FLOOR('-10.5'::DECIMAL) +SELECT FLOOR(decimal '10.5'), FLOOR(decimal '-10.5') ---- 10 -11 @@ -169,17 +169,17 @@ SELECT FLOOR('-999.9'::DECIMAL(4,1)), FLOOR('-99999999.9'::DECIMAL(9,1)), FLOOR( # test unary ROUND function query III -SELECT ROUND('0.1'::DECIMAL), ROUND('-0.1'::DECIMAL), ROUND(NULL::DECIMAL) +SELECT ROUND(decimal '0.1'), ROUND(decimal '-0.1'), ROUND(NULL::DECIMAL) ---- 0 0 NULL query II -SELECT ROUND('100.3'::DECIMAL), ROUND('-127012.3'::DECIMAL) +SELECT ROUND(decimal '100.3'), ROUND(decimal '-127012.3') ---- 100 -127012 query II -SELECT ROUND('10.5'::DECIMAL), ROUND('-10.5'::DECIMAL) +SELECT ROUND(decimal '10.5'), ROUND(decimal '-10.5') ---- 11 -11 diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctions.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctions.java index 6af137c138f..d3b0cddfa09 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctions.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctions.java @@ -33,9 +33,7 @@ import org.apache.calcite.avatica.util.DateTimeUtils; import org.apache.calcite.linq4j.function.NonDeterministic; import org.apache.calcite.runtime.SqlFunctions; -import org.apache.calcite.sql.type.SqlTypeName; import org.apache.ignite.internal.lang.IgniteStringBuilder; -import org.apache.ignite.internal.sql.engine.type.IgniteTypeSystem; import org.apache.ignite.internal.sql.engine.util.Commons; import org.apache.ignite.internal.sql.engine.util.IgniteMath; import org.apache.ignite.internal.sql.engine.util.TypeUtils; @@ -337,16 +335,6 @@ public static BigDecimal toBigDecimal(Number value, int precision, int scale) { return null; } - int defaultPrecision = IgniteTypeSystem.INSTANCE.getDefaultPrecision(SqlTypeName.DECIMAL); - - if (precision == defaultPrecision) { - BigDecimal dec = convertToBigDecimal(value); - // This branch covers at least one known case: access to dynamic parameter from context. - // In this scenario precision = DefaultTypePrecision, because types for dynamic params - // are created by toSql(createType(param.class)). - return dec; - } - if (value.longValue() == 0) { return processFractionData(value, precision, scale); } else { diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java index 406f63e659f..9dd47f807d9 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java @@ -39,7 +39,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; -import java.util.UUID; import org.apache.calcite.plan.RelOptTable; import org.apache.calcite.prepare.CalciteCatalogReader; import org.apache.calcite.prepare.Prepare; @@ -76,6 +75,7 @@ import org.apache.calcite.sql.dialect.CalciteSqlDialect; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.parser.SqlParserPos; +import org.apache.calcite.sql.type.BasicSqlType; import org.apache.calcite.sql.type.SqlTypeMappingRule; import org.apache.calcite.sql.type.SqlTypeName; import org.apache.calcite.sql.type.SqlTypeUtil; @@ -102,6 +102,7 @@ import org.apache.ignite.internal.sql.engine.util.IgniteCustomAssignmentsRules; import org.apache.ignite.internal.sql.engine.util.IgniteResource; import org.apache.ignite.internal.sql.engine.util.TypeUtils; +import org.apache.ignite.internal.type.NativeTypeSpec; import org.jetbrains.annotations.Nullable; /** Validator. */ @@ -110,6 +111,8 @@ public class IgniteSqlValidator extends SqlValidatorImpl { private static final BigDecimal DEC_INT_MAX = BigDecimal.valueOf(Integer.MAX_VALUE); public static final int MAX_LENGTH_OF_ALIASES = 256; + public static final int DECIMAL_DYNAMIC_PARAM_PRECISION = 28; + public static final int DECIMAL_DYNAMIC_PARAM_SCALE = 6; private static final Set HUMAN_READABLE_ALIASES_FOR; @@ -725,6 +728,19 @@ public void validateAggregateParams(SqlCall aggCall, /** {@inheritDoc} */ @Override public RelDataType deriveType(SqlValidatorScope scope, SqlNode expr) { + // if we already know the type, no need to re-derive + RelDataType type = getValidatedNodeTypeIfKnown(expr); + if (type != null) { + if (expr instanceof SqlDynamicParam) { + // Validated node type may be reassigned by the operators return type inference strategy and + // operands checker. Both of them are ot aware about DynamicParamState we use for validation, + // thus we need to update return type even if it was already assigned. + setDynamicParamType((SqlDynamicParam) expr, type); + } + + return type; + } + if (expr instanceof SqlDynamicParam) { return deriveDynamicParamType((SqlDynamicParam) expr); } @@ -863,6 +879,25 @@ private void validateCast(SqlValidatorScope scope, SqlNode expr) { return; } + returnType = typeFactory().createTypeWithNullability(returnType, operandType.isNullable()); + + setValidatedNodeType(expr, returnType); + + if (castOperand instanceof SqlDynamicParam + && operandType.getSqlTypeName() == SqlTypeName.DECIMAL + && returnType.getSqlTypeName() == SqlTypeName.DECIMAL + ) { + // By default type of dyn param of type DECIMAL is DECIMAL(28, 6) (see DECIMAL_DYNAMIC_PARAM_PRECISION and + // DECIMAL_DYNAMIC_PARAM_SCALE at the beginning of the class declaration). Although this default seems + // reasonable, it may not satisfy all of users. For those who need better control over type of dyn params + // there is an ability to specify more precise type by CAST operation. Therefore if type of the dyn param + // is decimal, and it immediately casted to DECIMAL as well, we need override type of the dyn param to desired + // one. + setDynamicParamType((SqlDynamicParam) castOperand, returnType); + + return; + } + RelDataType returnCustomType = returnType instanceof IgniteCustomType ? returnType : null; RelDataType operandCustomType = operandType instanceof IgniteCustomType ? operandType : null; @@ -1294,7 +1329,7 @@ protected void inferUnknownTypes(RelDataType inferredType, SqlValidatorScope sco } private void inferDynamicParamType(RelDataType inferredType, SqlDynamicParam dynamicParam) { - RelDataType type = deriveDynamicParamType(dynamicParam); + RelDataType type = deriveDynamicParamTypeIfNotKnown(dynamicParam); /* * If inferredType type is unknown and parameter is not specified, then use unknown type. @@ -1317,20 +1352,24 @@ private void inferDynamicParamType(RelDataType inferredType, SqlDynamicParam dyn } } + private RelDataType deriveDynamicParamTypeIfNotKnown(SqlDynamicParam dynamicParam) { + RelDataType validatedNodeType = getValidatedNodeTypeIfKnown(dynamicParam); + + if (validatedNodeType != null) { + return validatedNodeType; + } + + return deriveDynamicParamType(dynamicParam); + } + /** Derives the type of the given dynamic parameter. */ private RelDataType deriveDynamicParamType(SqlDynamicParam dynamicParam) { dynamicParamNodes.put(dynamicParam, dynamicParam); if (isUnspecified(dynamicParam)) { - RelDataType validatedNodeType = getValidatedNodeTypeIfKnown(dynamicParam); + setDynamicParamType(dynamicParam, unknownType); - if (validatedNodeType == null) { - setDynamicParamType(dynamicParam, unknownType); - return unknownType; - } else { - setDynamicParamType(dynamicParam, validatedNodeType); - return validatedNodeType; - } + return unknownType; } else { Object value = getDynamicParamValue(dynamicParam); RelDataType parameterType = deriveTypeFromDynamicParamValue(value); @@ -1347,20 +1386,40 @@ private RelDataType deriveDynamicParamType(SqlDynamicParam dynamicParam) { } private RelDataType deriveTypeFromDynamicParamValue(@Nullable Object value) { - IgniteTypeFactory typeFactory = typeFactory(); - - RelDataType parameterType; - // IgniteCustomType: first we must check whether dynamic parameter is a custom data type. - // If so call createCustomType with appropriate arguments. - if (value instanceof UUID) { - parameterType = typeFactory.createCustomType(UuidType.NAME); - } else if (value == null) { - parameterType = typeFactory.createSqlType(SqlTypeName.NULL); - } else { - parameterType = typeFactory.toSql(typeFactory.createType(value.getClass())); + if (value == null) { + return typeFactory.createSqlType(SqlTypeName.NULL); + } + + Class valueClass = value.getClass(); + + if (valueClass == Character.class) { + valueClass = String.class; } - return parameterType; + NativeTypeSpec spec = NativeTypeSpec.fromClass(valueClass); + + assert spec != null : "Unable to derive type from value: " + value; + + switch (spec) { + case INT8: return typeFactory.createSqlType(SqlTypeName.TINYINT); + case INT16: return typeFactory.createSqlType(SqlTypeName.SMALLINT); + case INT32: return typeFactory.createSqlType(INTEGER); + case INT64: return typeFactory.createSqlType(SqlTypeName.BIGINT); + case FLOAT: return typeFactory.createSqlType(SqlTypeName.REAL); + case DOUBLE: return typeFactory.createSqlType(SqlTypeName.DOUBLE); + case BOOLEAN: return typeFactory.createSqlType(SqlTypeName.BOOLEAN); + case UUID: return typeFactory().createCustomType(UuidType.NAME); + case DATE: return typeFactory.createSqlType(SqlTypeName.DATE); + case TIME: return typeFactory.createSqlType(SqlTypeName.TIME); + case DATETIME: return typeFactory.createSqlType(SqlTypeName.TIMESTAMP); + case TIMESTAMP: return typeFactory.createSqlType(SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE); + case DECIMAL: return typeFactory.createSqlType( + SqlTypeName.DECIMAL, DECIMAL_DYNAMIC_PARAM_PRECISION, DECIMAL_DYNAMIC_PARAM_SCALE + ); + case BYTES: return typeFactory.createSqlType(SqlTypeName.VARBINARY, BasicSqlType.PRECISION_NOT_SPECIFIED); + case STRING: return typeFactory.createSqlType(SqlTypeName.VARCHAR, BasicSqlType.PRECISION_NOT_SPECIFIED); + default: throw new AssertionError("Unknown type " + spec); + } } /** if dynamic parameter is not specified, set its type to the provided type, otherwise return the type of its value. */ @@ -1372,7 +1431,7 @@ RelDataType resolveDynamicParameterType(SqlDynamicParam dynamicParam, RelDataTyp return nullableContextType; } else { - return deriveDynamicParamType(dynamicParam); + return deriveDynamicParamTypeIfNotKnown(dynamicParam); } } @@ -1418,21 +1477,9 @@ private void validateInferredDynamicParameters() { continue; } - Object value = state.value; - RelDataType valueType = deriveTypeFromDynamicParamValue(value); RelDataType derivedType = getValidatedNodeTypeIfKnown(node); RelDataType paramType = state.resolvedType; - // Ensure that derived type matches parameter's value. - if (!SqlTypeUtil.equalSansNullability(derivedType, valueType)) { - String message = format( - "Type of dynamic parameter#{} value type does not match. Expected: {} derived: {}", - i, valueType.getFullTypeString(), derivedType.getFullTypeString() - ); - - throw new AssertionError(message); - } - if (!Objects.equals(paramType, derivedType)) { String message = format( "Type of dynamic parameter node#{} does not match. Expected: {} derived: {}", i, paramType.getFullTypeString(), diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctionsTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctionsTest.java index da55cf97c69..70db8086a3a 100644 --- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctionsTest.java +++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/exp/IgniteSqlFunctionsTest.java @@ -23,7 +23,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import java.math.BigDecimal; @@ -33,8 +32,6 @@ import java.util.Locale; import java.util.TimeZone; import java.util.function.Supplier; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.ignite.internal.sql.engine.type.IgniteTypeSystem; import org.apache.ignite.internal.sql.engine.util.IgniteMath; import org.apache.ignite.lang.ErrorGroups.Sql; import org.jetbrains.annotations.Nullable; @@ -171,15 +168,6 @@ public void testFractionsToDecimal() { ); } - /** Access of dynamic parameter value - parameter is not transformed. */ - @Test - public void testToBigDecimalFromObject() { - Object value = new BigDecimal("100.1"); - int defaultPrecision = IgniteTypeSystem.INSTANCE.getDefaultPrecision(SqlTypeName.DECIMAL); - - assertSame(value, IgniteSqlFunctions.toBigDecimal(value, defaultPrecision, 0)); - } - /** Tests for decimal conversion function. */ @ParameterizedTest @CsvSource({ @@ -232,6 +220,8 @@ public void testToBigDecimalFromObject() { "100.0, 3, 1, overflow", + "1, 32767, 32767, overflow", + "100.01, 4, 1, 100.0", "100.01, 4, 0, 100", "100.111, 3, 1, overflow", diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/DynamicParametersTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/DynamicParametersTest.java index e2bf0b57583..eb3c1766b37 100644 --- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/DynamicParametersTest.java +++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/DynamicParametersTest.java @@ -17,6 +17,10 @@ package org.apache.ignite.internal.sql.engine.planner; +import static org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_PRECISION; +import static org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_SCALE; + +import java.math.BigDecimal; import java.util.UUID; import java.util.function.Consumer; import java.util.stream.Stream; @@ -227,6 +231,11 @@ public Stream testStandalone() { .parameterTypes(nullable(NativeTypes.INT32)) .ok(), + checkStatement() + .sql("SELECT ?", BigDecimal.ONE) + .parameterTypes(nullable(NativeTypes.decimalOf(DECIMAL_DYNAMIC_PARAM_PRECISION, DECIMAL_DYNAMIC_PARAM_SCALE))) + .ok(), + checkStatement() .sql("SELECT ?", Unspecified.UNKNOWN) .fails("Unable to determine type of a dynamic parameter"), @@ -237,6 +246,18 @@ public Stream testStandalone() { // We are going to cast at runtime. .project("?0"), + checkStatement() + .sql("SELECT CAST(? AS DECIMAL(60, 30))", BigDecimal.ONE) + .parameterTypes(nullable(NativeTypes.decimalOf(60, 30))) + // We are going to cast at runtime. + .project("?0"), + + checkStatement() + .sql("SELECT ?::DECIMAL(60, 30)", BigDecimal.ONE) + .parameterTypes(nullable(NativeTypes.decimalOf(60, 30))) + // We are going to cast at runtime. + .project("?0"), + checkStatement() .sql("SELECT CAST(? AS INTEGER)", "1") .parameterTypes(nullable(NativeTypes.STRING)) diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/ImplicitCastsTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/ImplicitCastsTest.java index a5c7b5b01a9..07b81afedc1 100644 --- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/ImplicitCastsTest.java +++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/ImplicitCastsTest.java @@ -39,6 +39,7 @@ import org.apache.calcite.sql.type.SqlTypeUtil; import org.apache.ignite.internal.sql.engine.framework.TestBuilders; import org.apache.ignite.internal.sql.engine.framework.TestBuilders.TableBuilder; +import org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator; import org.apache.ignite.internal.sql.engine.rel.IgniteIndexScan; import org.apache.ignite.internal.sql.engine.rel.IgniteMergeJoin; import org.apache.ignite.internal.sql.engine.rel.IgniteNestedLoopJoin; @@ -111,6 +112,9 @@ private static Stream joinColumnTypes() { // Real/Float got mixed up. .filter(t -> t != SqlTypeName.FLOAT) .map(TYPE_FACTORY::createSqlType) + // tests in this class indifferent to particular precision and scale for DECIMAL type, + // therefor let's choose prec and scale which will be more convenient for test case generation + .map(type -> SqlTypeUtil.isDecimal(type) ? decimalDynParamType() : type) .collect(Collectors.toList()); List arguments = new ArrayList<>(); @@ -494,4 +498,10 @@ public boolean test(IgniteNestedLoopJoin node) { return Objects.equals(actualCondition, expectedCondition); } } + + private static RelDataType decimalDynParamType() { + return TYPE_FACTORY.createSqlType( + SqlTypeName.DECIMAL, IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_PRECISION, IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_SCALE + ); + } } diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericCaseTypeCoercionTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericCaseTypeCoercionTest.java index 9c00d64dd4f..fe380370cec 100644 --- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericCaseTypeCoercionTest.java +++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericCaseTypeCoercionTest.java @@ -17,8 +17,9 @@ package org.apache.ignite.internal.sql.engine.planner.datatypes; -import static org.apache.ignite.internal.catalog.commands.CatalogUtils.MAX_DECIMAL_PRECISION; import static org.apache.ignite.internal.lang.IgniteStringFormatter.format; +import static org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_PRECISION; +import static org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_SCALE; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.instanceOf; @@ -51,7 +52,9 @@ public class NumericCaseTypeCoercionTest extends BaseTypeCoercionTest { private static final IgniteSchema SCHEMA = createSchemaWithTwoColumnTable(NativeTypes.STRING, NativeTypes.STRING); - private static final NativeType DECIMAL_MAX_PREC = NativeTypes.decimalOf(MAX_DECIMAL_PRECISION, 0); + private static final NativeType DECIMAL_DYN_PARAM_DEFAULT = NativeTypes.decimalOf( + DECIMAL_DYNAMIC_PARAM_PRECISION, DECIMAL_DYNAMIC_PARAM_SCALE + ); /** CASE operands from columns. */ @ParameterizedTest @@ -651,40 +654,40 @@ private static Stream dynamicLiteralArgs() { .secondOpBeSame(), forTypePair(NumericPair.TINYINT_DECIMAL_1_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.TINYINT_DECIMAL_2_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.TINYINT_DECIMAL_4_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.TINYINT_DECIMAL_2_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.TINYINT_DECIMAL_3_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.TINYINT_DECIMAL_5_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.TINYINT_DECIMAL_5_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.TINYINT_DECIMAL_6_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.TINYINT_DECIMAL_8_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.TINYINT_REAL) .firstOpMatches(castTo(NativeTypes.FLOAT)) @@ -708,40 +711,40 @@ private static Stream dynamicLiteralArgs() { .secondOpBeSame(), forTypePair(NumericPair.SMALLINT_DECIMAL_1_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.SMALLINT_DECIMAL_2_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.SMALLINT_DECIMAL_4_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.SMALLINT_DECIMAL_2_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.SMALLINT_DECIMAL_3_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.SMALLINT_DECIMAL_5_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.SMALLINT_DECIMAL_5_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.SMALLINT_DECIMAL_6_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.SMALLINT_DECIMAL_8_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.SMALLINT_REAL) .firstOpMatches(castTo(NativeTypes.FLOAT)) @@ -761,40 +764,40 @@ private static Stream dynamicLiteralArgs() { .secondOpBeSame(), forTypePair(NumericPair.INT_DECIMAL_1_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.INT_DECIMAL_2_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.INT_DECIMAL_4_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.INT_DECIMAL_2_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.INT_DECIMAL_3_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.INT_DECIMAL_5_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.INT_DECIMAL_5_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.INT_DECIMAL_6_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.INT_DECIMAL_8_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.INT_REAL) .firstOpMatches(castTo(NativeTypes.FLOAT)) @@ -810,40 +813,40 @@ private static Stream dynamicLiteralArgs() { .secondOpBeSame(), forTypePair(NumericPair.BIGINT_DECIMAL_1_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.BIGINT_DECIMAL_2_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.BIGINT_DECIMAL_4_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.BIGINT_DECIMAL_2_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.BIGINT_DECIMAL_3_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.BIGINT_DECIMAL_5_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.BIGINT_DECIMAL_5_0) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.BIGINT_DECIMAL_6_1) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.BIGINT_DECIMAL_8_3) - .firstOpMatches(castTo(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(castTo(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.BIGINT_REAL) .firstOpMatches(castTo(NativeTypes.FLOAT)) @@ -855,40 +858,40 @@ private static Stream dynamicLiteralArgs() { forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_1_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_2_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_4_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_2_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_3_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_5_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_5_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_6_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_1_0_DECIMAL_8_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_1_0_REAL) .firstOpMatches(castTo(NativeTypes.DOUBLE)) @@ -900,28 +903,28 @@ private static Stream dynamicLiteralArgs() { forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_2_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_3_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_5_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_5_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_6_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_0_DECIMAL_8_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_0_REAL) .firstOpMatches(castTo(NativeTypes.DOUBLE)) @@ -933,36 +936,36 @@ private static Stream dynamicLiteralArgs() { forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_2_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_4_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_2_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_3_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_5_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_5_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_6_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_1_DECIMAL_8_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_2_1_REAL) .firstOpMatches(castTo(NativeTypes.DOUBLE)) @@ -974,32 +977,32 @@ private static Stream dynamicLiteralArgs() { forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_4_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_2_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_3_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_5_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_5_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_6_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_4_3_DECIMAL_8_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_4_3_REAL) .firstOpMatches(castTo(NativeTypes.DOUBLE)) @@ -1010,24 +1013,24 @@ private static Stream dynamicLiteralArgs() { .secondOpBeSame(), forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_3_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_5_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_5_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_6_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_3_1_DECIMAL_8_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_3_1_REAL) .firstOpMatches(castTo(NativeTypes.DOUBLE)) @@ -1039,20 +1042,20 @@ private static Stream dynamicLiteralArgs() { forTypePair(NumericPair.DECIMAL_5_3_DECIMAL_5_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_5_3_DECIMAL_5_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_5_3_DECIMAL_6_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_5_3_DECIMAL_8_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_5_3_REAL) .firstOpMatches(castTo(NativeTypes.DOUBLE)) @@ -1064,16 +1067,16 @@ private static Stream dynamicLiteralArgs() { forTypePair(NumericPair.DECIMAL_5_0_DECIMAL_5_0) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_5_0_DECIMAL_6_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_5_0_DECIMAL_8_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_5_0_REAL) .firstOpMatches(castTo(NativeTypes.DOUBLE)) @@ -1085,12 +1088,12 @@ private static Stream dynamicLiteralArgs() { forTypePair(NumericPair.DECIMAL_6_1_DECIMAL_6_1) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_6_1_DECIMAL_8_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_6_1_REAL) .firstOpMatches(castTo(NativeTypes.DOUBLE)) @@ -1102,8 +1105,8 @@ private static Stream dynamicLiteralArgs() { forTypePair(NumericPair.DECIMAL_8_3_DECIMAL_8_3) - .firstOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)) - .secondOpMatches(ofTypeWithoutCast(DECIMAL_MAX_PREC)), + .firstOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)) + .secondOpMatches(ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT)), forTypePair(NumericPair.DECIMAL_8_3_REAL) .firstOpMatches(castTo(NativeTypes.DOUBLE)) diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericInTypeCoercionTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericInTypeCoercionTest.java index e92644fdc0f..2231b64d7d8 100644 --- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericInTypeCoercionTest.java +++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/NumericInTypeCoercionTest.java @@ -17,6 +17,9 @@ package org.apache.ignite.internal.sql.engine.planner.datatypes; +import static org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_PRECISION; +import static org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_SCALE; + import java.util.List; import java.util.function.Predicate; import java.util.stream.Stream; @@ -46,7 +49,9 @@ */ public class NumericInTypeCoercionTest extends BaseTypeCoercionTest { - private static final NativeType DECIMAL_DEFAULT = NativeTypes.decimalOf(32767, 0); + private static final NativeType DECIMAL_DYN_PARAM_DEFAULT = NativeTypes.decimalOf( + DECIMAL_DYNAMIC_PARAM_PRECISION, DECIMAL_DYNAMIC_PARAM_SCALE + ); private static Stream lhsNonDecimal() { return Stream.of( @@ -1092,7 +1097,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_1_0_REAL, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), castTo(Types.DECIMAL_1_0) ), @@ -1100,7 +1105,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_1_0_DOUBLE, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), castTo(Types.DECIMAL_1_0) ), @@ -1108,73 +1113,73 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_1_0, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_2_0, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_2_1, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_3_1, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_4_3, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_5_0, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_5_3, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_6_1, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_8_3, ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), // DECIMAL (2, 0) @@ -1182,7 +1187,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_2_0_REAL, ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), castTo(Types.DECIMAL_2_0) ), @@ -1190,7 +1195,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_2_0_DOUBLE, ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), castTo(Types.DECIMAL_2_0) ), @@ -1198,49 +1203,49 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_2_0, ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_3_1, ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_5_0, ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_5_3, ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_6_1, ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_8_3, ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), // DECIMAL (2, 1) @@ -1248,7 +1253,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_2_1_REAL, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), castTo(Types.DECIMAL_2_1) ), @@ -1256,7 +1261,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_2_1_DOUBLE, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), castTo(Types.DECIMAL_2_1) ), @@ -1264,65 +1269,65 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_2_0, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_2_1, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_3_1, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_4_3, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_5_0, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_5_3, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_6_1, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_8_3, ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), // DECIMAL (4, 3) @@ -1330,7 +1335,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_4_3_REAL, ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), castTo(Types.DECIMAL_4_3) ), @@ -1338,7 +1343,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_4_3_DOUBLE, ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), castTo(Types.DECIMAL_4_3) ), @@ -1346,57 +1351,57 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_2_0, ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_3_1, ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_4_3, ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_5_0, ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_5_3, ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_6_1, ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_8_3, ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), // DECIMAL (3, 1) @@ -1404,7 +1409,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_3_1_REAL, ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), castTo(Types.DECIMAL_3_1) ), @@ -1412,7 +1417,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_3_1_DOUBLE, ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), castTo(Types.DECIMAL_3_1) ), @@ -1420,41 +1425,41 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_3_1, ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_5_0, ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_5_3, ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_6_1, ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_8_3, ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), // DECIMAL (5, 0) @@ -1462,7 +1467,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_5_0_REAL, ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), castTo(Types.DECIMAL_5_0) ), @@ -1470,7 +1475,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_5_0_DOUBLE, ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), castTo(Types.DECIMAL_5_0) ), @@ -1478,25 +1483,25 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_5_0_DECIMAL_5_0, ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_5_0_DECIMAL_6_1, ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_5_0_DECIMAL_8_3, ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), // DECIMAL (5, 3) @@ -1504,7 +1509,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_5_3_REAL, ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), castTo(Types.DECIMAL_5_3) ), @@ -1512,7 +1517,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_5_3_DOUBLE, ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), castTo(Types.DECIMAL_5_3) ), @@ -1520,33 +1525,33 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_5_3_DECIMAL_5_0, ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_5_3_DECIMAL_5_3, ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_5_3_DECIMAL_6_1, ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_5_3_DECIMAL_8_3, ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), // DECIMAL (6, 1) @@ -1554,7 +1559,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_6_1_REAL, ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1), castTo(Types.DECIMAL_6_1) ), @@ -1562,7 +1567,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_6_1_DOUBLE, ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1), castTo(Types.DECIMAL_6_1) ), @@ -1570,17 +1575,17 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_6_1_DECIMAL_6_1, ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_6_1_DECIMAL_8_3, ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ), // DECIMAL (8, 3) @@ -1588,7 +1593,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_8_3_REAL, ofTypeWithoutCast(Types.DECIMAL_8_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3), castTo(Types.DECIMAL_8_3) ), @@ -1596,7 +1601,7 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_8_3_DOUBLE, ofTypeWithoutCast(Types.DECIMAL_8_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3), castTo(Types.DECIMAL_8_3) ), @@ -1604,9 +1609,9 @@ private static Stream inOperandsDynamicParamsRhs() { Arguments.of( NumericPair.DECIMAL_8_3_DECIMAL_8_3, ofTypeWithoutCast(Types.DECIMAL_8_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3), - ofTypeWithoutCast(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT) ) ); @@ -1658,89 +1663,89 @@ private static Stream inOperandsDynamicParamLhs() { Arguments.of( NumericPair.DECIMAL_1_0_REAL, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DOUBLE, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_1_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_2_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_2_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_3_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_4_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_5_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_5_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_6_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1) ), Arguments.of( NumericPair.DECIMAL_1_0_DECIMAL_8_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_1_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3) ), @@ -1748,65 +1753,65 @@ private static Stream inOperandsDynamicParamLhs() { Arguments.of( NumericPair.DECIMAL_2_0_REAL, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_0_DOUBLE, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_2_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_3_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_5_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_5_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_6_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1) ), Arguments.of( NumericPair.DECIMAL_2_0_DECIMAL_8_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3) ), @@ -1814,81 +1819,81 @@ private static Stream inOperandsDynamicParamLhs() { Arguments.of( NumericPair.DECIMAL_2_1_REAL, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_1_DOUBLE, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_2_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_2_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_3_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_4_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_5_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_5_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_6_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1) ), Arguments.of( NumericPair.DECIMAL_2_1_DECIMAL_8_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3) ), @@ -1896,57 +1901,57 @@ private static Stream inOperandsDynamicParamLhs() { Arguments.of( NumericPair.DECIMAL_3_1_REAL, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_3_1_DOUBLE, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_3_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1) ), Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_5_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0) ), Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_5_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3) ), Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_6_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1) ), Arguments.of( NumericPair.DECIMAL_3_1_DECIMAL_8_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3) ), @@ -1954,73 +1959,73 @@ private static Stream inOperandsDynamicParamLhs() { Arguments.of( NumericPair.DECIMAL_4_3_REAL, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_4_3_DOUBLE, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_2_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_2_0) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_3_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_3_1) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_4_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_5_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_5_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_6_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1) ), Arguments.of( NumericPair.DECIMAL_4_3_DECIMAL_8_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_4_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3) ), @@ -2028,41 +2033,41 @@ private static Stream inOperandsDynamicParamLhs() { Arguments.of( NumericPair.DECIMAL_5_0_REAL, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_5_0_DOUBLE, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_5_0_DECIMAL_5_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0) ), Arguments.of( NumericPair.DECIMAL_5_0_DECIMAL_6_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1) ), Arguments.of( NumericPair.DECIMAL_5_0_DECIMAL_8_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3) ), @@ -2070,49 +2075,49 @@ private static Stream inOperandsDynamicParamLhs() { Arguments.of( NumericPair.DECIMAL_5_3_REAL, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_5_3_DOUBLE, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_5_3_DECIMAL_5_0, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_0) ), Arguments.of( NumericPair.DECIMAL_5_3_DECIMAL_5_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3) ), Arguments.of( NumericPair.DECIMAL_5_3_DECIMAL_6_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1) ), Arguments.of( NumericPair.DECIMAL_5_3_DECIMAL_8_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_5_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3) ), @@ -2120,33 +2125,33 @@ private static Stream inOperandsDynamicParamLhs() { Arguments.of( NumericPair.DECIMAL_6_1_REAL, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_6_1_DOUBLE, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_6_1_DECIMAL_6_1, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1) ), Arguments.of( NumericPair.DECIMAL_6_1_DECIMAL_8_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_6_1), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3) ), @@ -2154,25 +2159,25 @@ private static Stream inOperandsDynamicParamLhs() { Arguments.of( NumericPair.DECIMAL_8_3_REAL, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_8_3_DOUBLE, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), - castTo(DECIMAL_DEFAULT) + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), + castTo(DECIMAL_DYN_PARAM_DEFAULT) ), Arguments.of( NumericPair.DECIMAL_8_3_DECIMAL_8_3, - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3), - ofTypeWithoutCast(DECIMAL_DEFAULT), + ofTypeWithoutCast(DECIMAL_DYN_PARAM_DEFAULT), ofTypeWithoutCast(Types.DECIMAL_8_3) ) ); diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/PrepareServiceImplTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/PrepareServiceImplTest.java index 005b221197e..e9ff9280334 100644 --- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/PrepareServiceImplTest.java +++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/PrepareServiceImplTest.java @@ -362,7 +362,8 @@ private static Stream parameterTypes() { Arguments.of(NativeTypes.INT64, noPrecision, noScale), Arguments.of(NativeTypes.FLOAT, noPrecision, noScale), Arguments.of(NativeTypes.DOUBLE, noPrecision, noScale), - Arguments.of(NativeTypes.decimalOf(10, 2), Short.MAX_VALUE, 0), + Arguments.of(NativeTypes.decimalOf(10, 2), + IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_PRECISION, IgniteSqlValidator.DECIMAL_DYNAMIC_PARAM_SCALE), Arguments.of(NativeTypes.stringOf(42), -1, noScale), Arguments.of(NativeTypes.blobOf(42), -1, noScale), Arguments.of(NativeTypes.UUID, noPrecision, noScale), diff --git a/modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java b/modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java index 18542ae7430..faabedf8b7d 100644 --- a/modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java +++ b/modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java @@ -472,8 +472,12 @@ public static RexNode generateLiteralOrValueExpr(ColumnType type, @Nullable Obje case DOUBLE: BigDecimal doubleValue = new BigDecimal(requireNonNull(value).toString()); return rexBuilder.makeLiteral(doubleValue, typeFactory.createSqlType(SqlTypeName.DOUBLE)); - case DECIMAL: - return rexBuilder.makeLiteral(value, typeFactory.createSqlType(SqlTypeName.DECIMAL)); + case DECIMAL: { + int precision = typeFactory.getTypeSystem().getMaxPrecision(SqlTypeName.DECIMAL); + int scale = ((BigDecimal) value).scale(); + + return rexBuilder.makeLiteral(value, typeFactory.createSqlType(SqlTypeName.DECIMAL, precision, scale)); + } case DATE: LocalDate localDate = (LocalDate) value; int epochDay = (int) requireNonNull(localDate).toEpochDay();