This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 45f6cba837d1e6222c15d231e65a3f07c7d7de4a Author: xy <[email protected]> AuthorDate: Mon Jan 22 15:10:46 2024 +0800 [fix](Nereids) Fixed a bug where the execution plan was incorrect after ddl (#30107) should only compare column name when generate data dist info of PhysicalOlapScan Co-authored-by: xingying01 <[email protected]> --- .../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: [email protected] For additional commands, e-mail: [email protected]
