You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by pa...@apache.org on 2023/11/10 09:48:39 UTC
(doris) branch cp_1110_3 created (now 83c34821bf8)
This is an automated email from the ASF dual-hosted git repository.
panxiaolei pushed a change to branch cp_1110_3
in repository https://gitbox.apache.org/repos/asf/doris.git
at 83c34821bf8 [Bug](decimalv2) getCmpType return decimalv2 when lhs/rhs type both is decimalv2 (#26705)
This branch includes the following new commits:
new 83c34821bf8 [Bug](decimalv2) getCmpType return decimalv2 when lhs/rhs type both is decimalv2 (#26705)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
(doris) 01/01: [Bug](decimalv2) getCmpType return decimalv2 when lhs/rhs type both is decimalv2 (#26705)
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
panxiaolei pushed a commit to branch cp_1110_3
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 83c34821bf8583077655bae3b5debf03e2ae7295
Author: Pxl <px...@qq.com>
AuthorDate: Fri Nov 10 16:21:28 2023 +0800
[Bug](decimalv2) getCmpType return decimalv2 when lhs/rhs type both is decimalv2 (#26705)
getCmpType return decimalv2 when lhs/rhs type both is decimalv2
---
.../org/apache/doris/analysis/BinaryPredicate.java | 6 ++++++
regression-test/suites/delete_p0/test_delete.groovy | 20 ++++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
index bce4807357b..5f41faa3c40 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
@@ -422,6 +422,12 @@ public class BinaryPredicate extends Predicate implements Writable {
if (t1 == PrimitiveType.BIGINT && t2 == PrimitiveType.BIGINT) {
return Type.getAssignmentCompatibleType(getChild(0).getType(), getChild(1).getType(), false);
}
+
+ if (t1 == PrimitiveType.DECIMALV2 && t2 == PrimitiveType.DECIMALV2) {
+ return ScalarType.getAssignmentCompatibleDecimalV2Type((ScalarType) getChild(0).getType(),
+ (ScalarType) getChild(1).getType());
+ }
+
if ((t1 == PrimitiveType.BIGINT && t2 == PrimitiveType.DECIMALV2)
|| (t2 == PrimitiveType.BIGINT && t1 == PrimitiveType.DECIMALV2)
|| (t1 == PrimitiveType.LARGEINT && t2 == PrimitiveType.DECIMALV2)
diff --git a/regression-test/suites/delete_p0/test_delete.groovy b/regression-test/suites/delete_p0/test_delete.groovy
index aff35b978cc..2fef1c7be6a 100644
--- a/regression-test/suites/delete_p0/test_delete.groovy
+++ b/regression-test/suites/delete_p0/test_delete.groovy
@@ -280,4 +280,24 @@ PROPERTIES
"""
sql "delete from dwd_pay partitions(p202310) where pay_time = '20231002';"
+
+ sql """
+ ADMIN SET FRONTEND CONFIG ('disable_decimalv2' = 'false');
+ """
+
+ sql "drop table if exists test"
+ sql """
+ CREATE TABLE `test`
+ (
+ col_1 int,
+ col_2 decimalv2(10,3)
+ )ENGINE=OLAP
+ duplicate KEY(`col_1`)
+ COMMENT 'OLAP'
+ DISTRIBUTED BY HASH(`col_1`) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+ sql "DELETE FROM test WHERE col_2 = cast(123.45 as decimalv2(10,3));"
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org