This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new e930123de74 [fix](Nereids) system default decimalv3 scale should be 9
(#32756)
e930123de74 is described below
commit e930123de742931127784ab5e578b8f9d1965d11
Author: morrySnow <[email protected]>
AuthorDate: Mon Mar 25 21:41:08 2024 +0800
[fix](Nereids) system default decimalv3 scale should be 9 (#32756)
pick from master #32754
---
.../main/java/org/apache/doris/nereids/types/DecimalV3Type.java | 2 +-
.../java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV3Type.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV3Type.java
index 80e9adbb906..637dbfdc054 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV3Type.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV3Type.java
@@ -40,7 +40,7 @@ public class DecimalV3Type extends FractionalType {
public static final int MAX_DECIMAL128_PRECISION = 38;
public static final DecimalV3Type WILDCARD = new DecimalV3Type(-1, -1);
- public static final DecimalV3Type SYSTEM_DEFAULT = new
DecimalV3Type(MAX_DECIMAL128_PRECISION, DEFAULT_SCALE);
+ public static final DecimalV3Type SYSTEM_DEFAULT = new
DecimalV3Type(MAX_DECIMAL128_PRECISION, 9);
public static final DecimalV3Type CATALOG_DEFAULT = new
DecimalV3Type(MAX_DECIMAL32_PRECISION, DEFAULT_SCALE);
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java
b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java
index 78a028624f0..2b82db80430 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java
@@ -284,7 +284,7 @@ public class TypeCoercionUtilsTest {
testFindCommonPrimitiveTypeForCaseWhen(LargeIntType.INSTANCE,
LargeIntType.INSTANCE, BigIntType.INSTANCE);
testFindCommonPrimitiveTypeForCaseWhen(LargeIntType.INSTANCE,
LargeIntType.INSTANCE, LargeIntType.INSTANCE);
testFindCommonPrimitiveTypeForCaseWhen(DecimalV2Type.SYSTEM_DEFAULT,
LargeIntType.INSTANCE, DecimalV2Type.SYSTEM_DEFAULT);
- testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.SYSTEM_DEFAULT,
LargeIntType.INSTANCE, DecimalV3Type.SYSTEM_DEFAULT);
+
testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.createDecimalV3Type(38),
LargeIntType.INSTANCE, DecimalV3Type.createDecimalV3Type(38));
testFindCommonPrimitiveTypeForCaseWhen(DoubleType.INSTANCE,
LargeIntType.INSTANCE, FloatType.INSTANCE);
testFindCommonPrimitiveTypeForCaseWhen(DoubleType.INSTANCE,
LargeIntType.INSTANCE, DoubleType.INSTANCE);
testFindCommonPrimitiveTypeForCaseWhen(StringType.INSTANCE,
LargeIntType.INSTANCE, CharType.SYSTEM_DEFAULT);
@@ -308,7 +308,7 @@ public class TypeCoercionUtilsTest {
testFindCommonPrimitiveTypeForCaseWhen(DecimalV2Type.SYSTEM_DEFAULT,
DecimalV2Type.SYSTEM_DEFAULT, LargeIntType.INSTANCE);
testFindCommonPrimitiveTypeForCaseWhen(DecimalV2Type.SYSTEM_DEFAULT,
DecimalV2Type.SYSTEM_DEFAULT,
DecimalV2Type.SYSTEM_DEFAULT);
- testFindCommonPrimitiveTypeForCaseWhen(DoubleType.INSTANCE,
DecimalV2Type.SYSTEM_DEFAULT,
+ testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.SYSTEM_DEFAULT,
DecimalV2Type.SYSTEM_DEFAULT,
DecimalV3Type.SYSTEM_DEFAULT);
testFindCommonPrimitiveTypeForCaseWhen(DoubleType.INSTANCE,
DecimalV2Type.SYSTEM_DEFAULT, FloatType.INSTANCE);
testFindCommonPrimitiveTypeForCaseWhen(DoubleType.INSTANCE,
DecimalV2Type.SYSTEM_DEFAULT, DoubleType.INSTANCE);
@@ -331,10 +331,10 @@ public class TypeCoercionUtilsTest {
testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.SYSTEM_DEFAULT,
DecimalV3Type.SYSTEM_DEFAULT, SmallIntType.INSTANCE);
testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.SYSTEM_DEFAULT,
DecimalV3Type.SYSTEM_DEFAULT, IntegerType.INSTANCE);
testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.SYSTEM_DEFAULT,
DecimalV3Type.SYSTEM_DEFAULT, BigIntType.INSTANCE);
- testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.SYSTEM_DEFAULT,
DecimalV3Type.SYSTEM_DEFAULT, LargeIntType.INSTANCE);
+
testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.createDecimalV3Type(38),
DecimalV3Type.createDecimalV3Type(38), LargeIntType.INSTANCE);
testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.SYSTEM_DEFAULT,
DecimalV3Type.SYSTEM_DEFAULT,
DecimalV2Type.createDecimalV2Type(27, 0));
- testFindCommonPrimitiveTypeForCaseWhen(DoubleType.INSTANCE,
DecimalV3Type.SYSTEM_DEFAULT,
+ testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.SYSTEM_DEFAULT,
DecimalV3Type.SYSTEM_DEFAULT,
DecimalV2Type.SYSTEM_DEFAULT);
testFindCommonPrimitiveTypeForCaseWhen(DecimalV3Type.SYSTEM_DEFAULT,
DecimalV3Type.SYSTEM_DEFAULT,
DecimalV3Type.SYSTEM_DEFAULT);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]