You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by hu...@apache.org on 2025/10/31 04:46:55 UTC
(doris) 12/13: fix npe
This is an automated email from the ASF dual-hosted git repository.
huajianlan pushed a commit to branch nested_column_prune
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 490886b37b2a672a07bd61199ff130cfa10180dd
Author: 924060929 <la...@selectdb.com>
AuthorDate: Fri Oct 31 11:01:02 2025 +0800
fix npe
---
.../nereids/rules/rewrite/PushDownProject.java | 22 ++++++++++++++++++----
.../java/org/apache/doris/planner/PlanNode.java | 2 +-
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownProject.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownProject.java
index 3a307d26ec8..8b1fbaac8ae 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownProject.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownProject.java
@@ -99,12 +99,26 @@ public class PushDownProject implements RewriteRuleFactory, NormalizeToSlot {
pushedOutput.add(new ArrayList<>(join.right().getOutput()));
if (rewriteHashJoinConjunctsResult.isPresent()) {
- pushedOutput.get(0).addAll(rewriteHashJoinConjunctsResult.get().second.get(0));
- pushedOutput.get(1).addAll(rewriteHashJoinConjunctsResult.get().second.get(1));
+ Map<Integer, List<NamedExpression>> childIndexToConjuncts = rewriteHashJoinConjunctsResult.get().second;
+ List<NamedExpression> leftConjuncts = childIndexToConjuncts.get(0);
+ if (leftConjuncts != null) {
+ pushedOutput.get(0).addAll(leftConjuncts);
+ }
+ List<NamedExpression> rightConjuncts = childIndexToConjuncts.get(1);
+ if (rightConjuncts != null) {
+ pushedOutput.get(1).addAll(rightConjuncts);
+ }
}
if (rewriteOtherJoinConjunctsResult.isPresent()) {
- pushedOutput.get(0).addAll(rewriteOtherJoinConjunctsResult.get().second.get(0));
- pushedOutput.get(1).addAll(rewriteOtherJoinConjunctsResult.get().second.get(1));
+ Map<Integer, List<NamedExpression>> childIndexToConjuncts = rewriteOtherJoinConjunctsResult.get().second;
+ List<NamedExpression> leftOtherConjuncts = childIndexToConjuncts.get(0);
+ if (leftOtherConjuncts != null) {
+ pushedOutput.get(0).addAll(leftOtherConjuncts);
+ }
+ List<NamedExpression> rightOtherConjuncts = childIndexToConjuncts.get(1);
+ if (rightOtherConjuncts != null) {
+ pushedOutput.get(1).addAll(rightOtherConjuncts);
+ }
}
Plan newLeft = join.left();
diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
index ad5f0037a1e..861780ead2b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
@@ -937,7 +937,7 @@ public abstract class PlanNode extends TreeNode<PlanNode> implements PlanStats {
boolean printNestedColumnsHeader = true;
for (SlotDescriptor slot : tupleDesc.getSlots()) {
String prunedType = null;
- if (!slot.getType().equals(slot.getColumn().getType())) {
+ if (slot.getColumn() != null && !slot.getType().equals(slot.getColumn().getType())) {
prunedType = slot.getType().toString();
}
String displayAllAccessPathsString = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org