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 b2a048deff98bb32d3463b29b6b153b21798ea7a Author: 924060929 <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
