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 60c3410f43 [fix](planner)need recalculate nullable info of output
slots for join node (#21651)
60c3410f43 is described below
commit 60c3410f43b517d4344c184d4372482327bef609
Author: starocean999 <[email protected]>
AuthorDate: Mon Jul 10 09:50:43 2023 +0800
[fix](planner)need recalculate nullable info of output slots for join node
(#21651)
pick from master #21650
---
.../java/org/apache/doris/analysis/ExprSubstitutionMap.java | 10 ++++++++++
.../src/main/java/org/apache/doris/planner/JoinNodeBase.java | 9 +++++++++
2 files changed, 19 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/ExprSubstitutionMap.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/ExprSubstitutionMap.java
index b88d7a91e9..b483f50285 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/analysis/ExprSubstitutionMap.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/analysis/ExprSubstitutionMap.java
@@ -335,4 +335,14 @@ public final class ExprSubstitutionMap {
public ExprSubstitutionMap clone() {
return new ExprSubstitutionMap(Expr.cloneList(lhs),
Expr.cloneList(rhs));
}
+
+ public void reCalculateNullableInfoForSlotInRhs() {
+ Preconditions.checkState(lhs.size() == rhs.size(), "lhs and rhs must
be same size");
+ for (int i = 0; i < rhs.size(); i++) {
+ if (rhs.get(i) instanceof SlotRef) {
+ ((SlotRef)
rhs.get(i)).getDesc().setIsNullable(lhs.get(i).isNullable()
+ || ((SlotRef) rhs.get(i)).getDesc().getIsNullable());
+ }
+ }
+ }
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
b/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
index 21ef809f31..3b0f301709 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
@@ -433,6 +433,15 @@ public abstract class JoinNodeBase extends PlanNode {
}
// 5. replace tuple is null expr
TupleIsNullPredicate.substitueListForTupleIsNull(vSrcToOutputSMap.getLhs(),
originTidsToIntermediateTidMap);
+
+ Preconditions.checkState(vSrcToOutputSMap.getLhs().size() ==
vOutputTupleDesc.getSlots().size());
+ List<Expr> exprs = vSrcToOutputSMap.getLhs();
+ ArrayList<SlotDescriptor> slots = vOutputTupleDesc.getSlots();
+ for (int i = 0; i < slots.size(); i++) {
+ slots.get(i).setIsNullable(exprs.get(i).isNullable() ||
slots.get(i).getIsNullable());
+ }
+ vSrcToOutputSMap.reCalculateNullableInfoForSlotInRhs();
+ vOutputTupleDesc.computeMemLayout();
}
protected abstract List<SlotId> computeSlotIdsForJoinConjuncts(Analyzer
analyzer);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]