From b113ff368aeb6ebcc684658390ad4a147fac30f7 Mon Sep 17 00:00:00 2001 From: jackwener Date: Wed, 17 Apr 2024 13:53:33 +0800 Subject: [PATCH] [minor](Nereids): remove useless stream filter() in Translator --- .../nereids/glue/translator/PhysicalPlanTranslator.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java index 205cfbd25309d8..3ef703fc03b490 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java @@ -1387,7 +1387,6 @@ public PlanFragment visitPhysicalHashJoin( hashJoin.getOtherJoinConjuncts() .stream() - .filter(e -> !(e.equals(BooleanLiteral.TRUE))) .flatMap(e -> e.getInputSlots().stream()) .map(SlotReference.class::cast) .forEach(s -> hashOutputSlotReferenceMap.put(s.getExprId(), s)); @@ -1529,11 +1528,10 @@ public PlanFragment visitPhysicalHashJoin( leftIntermediateSlotDescriptor.forEach(sd -> sd.setIsNullable(true)); } + // Constant expr will cause be crash. + // But EliminateJoinCondition and Expression Rewrite already eliminate true literal. List otherJoinConjuncts = hashJoin.getOtherJoinConjuncts() .stream() - // TODO add constant expr will cause be crash, currently we only handle true literal. - // remove it after Nereids could ensure no constant expr in other join condition - .filter(e -> !(e.equals(BooleanLiteral.TRUE))) .map(e -> ExpressionTranslator.translate(e, context)) .collect(Collectors.toList());