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

yiguolei pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new 8350d82900 [fix](planner)bucket shuffle join should allow key type is 
varchar and string type even with different type length (#17600)
8350d82900 is described below

commit 8350d82900900aca1660b3d838d0ef7a0bb7a99b
Author: starocean999 <[email protected]>
AuthorDate: Thu Mar 9 14:07:06 2023 +0800

    [fix](planner)bucket shuffle join should allow key type is varchar and 
string type even with different type length (#17600)
---
 fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java       | 5 +++++
 .../src/main/java/org/apache/doris/planner/DistributedPlanner.java  | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java 
b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
index f6b3f00742..f5d02f5ae1 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
@@ -302,6 +302,11 @@ public abstract class Type {
                 || isScalarType(PrimitiveType.STRING);
     }
 
+    public boolean isVarcharOrStringType() {
+        return isScalarType(PrimitiveType.VARCHAR)
+                || isScalarType(PrimitiveType.STRING);
+    }
+
     public boolean isVarchar() {
         return isScalarType(PrimitiveType.VARCHAR);
     }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
index e91a674692..88dcd40e38 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
@@ -687,7 +687,11 @@ public class DistributedPlanner {
                 // check the rhs join expr type is same as distribute column
                 for (int j = 0; j < leftJoinColumnNames.size(); j++) {
                     if 
(leftJoinColumnNames.get(j).equals(distributeColumnName)) {
-                        if 
(rightExprs.get(j).getType().equals(leftDistributeColumns.get(i).getType())) {
+                        // varchar and string type don't need to check the 
length property
+                        if 
((rightExprs.get(j).getType().isVarcharOrStringType()
+                                && 
leftDistributeColumns.get(i).getType().isVarcharOrStringType())
+                                || (rightExprs.get(j).getType()
+                                        
.equals(leftDistributeColumns.get(i).getType()))) {
                             rhsJoinExprs.add(rightExprs.get(j));
                             findRhsExprs = true;
                             break;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to