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

yiguolei 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 beb71fbea2c [fix](Nereids) Fixed a bug where the execution plan was 
incorrect after ddl (#30224)
beb71fbea2c is described below

commit beb71fbea2cfabbd2facb0b5ec5847ecfa8456bb
Author: xy <whuxingy...@163.com>
AuthorDate: Wed Jan 24 12:02:49 2024 +0800

    [fix](Nereids) Fixed a bug where the execution plan was incorrect after ddl 
(#30224)
    
    Co-authored-by: xingying01 <xingyin...@corp.netease.com>
---
 .../implementation/LogicalOlapScanToPhysicalOlapScan.java      | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalOlapScanToPhysicalOlapScan.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalOlapScanToPhysicalOlapScan.java
index 6bcf22a9adc..43436355ae1 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalOlapScanToPhysicalOlapScan.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalOlapScanToPhysicalOlapScan.java
@@ -94,7 +94,10 @@ public class LogicalOlapScanToPhysicalOlapScan extends 
OneImplementationRuleFact
                 if (hashColumns.size() != 
hashDistributionInfo.getDistributionColumns().size()) {
                     for (Slot slot : baseOutput) {
                         for (Column column : 
hashDistributionInfo.getDistributionColumns()) {
-                            if (((SlotReference) 
slot).getColumn().get().equals(column)) {
+                            // If the length of the column in the bucket key 
changes after DDL, the length cannot be
+                            // determined. As a result, some bucket fields are 
lost in the query execution plan.
+                            // So here we use the column name to avoid this 
problem
+                            if (((SlotReference) 
slot).getColumn().get().getName().equalsIgnoreCase(column.getName())) {
                                 hashColumns.add(slot.getExprId());
                             }
                         }
@@ -108,7 +111,10 @@ public class LogicalOlapScanToPhysicalOlapScan extends 
OneImplementationRuleFact
                 List<ExprId> hashColumns = Lists.newArrayList();
                 for (Slot slot : output) {
                     for (Column column : 
hashDistributionInfo.getDistributionColumns()) {
-                        if (((SlotReference) 
slot).getColumn().get().equals(column)) {
+                        // If the length of the column in the bucket key 
changes after DDL, the length cannot be
+                        // determined. As a result, some bucket fields are 
lost in the query execution plan.
+                        // So here we use the column name to avoid this problem
+                        if (((SlotReference) 
slot).getColumn().get().getName().equalsIgnoreCase(column.getName())) {
                             hashColumns.add(slot.getExprId());
                         }
                     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to