From f466a072d84271eda47af95c09cb83bbffe06ba0 Mon Sep 17 00:00:00 2001 From: minghong Date: Mon, 5 Sep 2022 19:09:27 +0800 Subject: [PATCH] fix bug: tpch-q12 invalid type (#12347) In old planner, Predicate set its type in analyzeImpl(). However, function analyzeImpl() is in old planner path, but not in nereids path. And hence the type is invalid. Because all predicate has type bool, we set its type in constructor. --- .../src/main/java/org/apache/doris/analysis/Predicate.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Predicate.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/Predicate.java index b2fb78cc4c..5372b08c4f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Predicate.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Predicate.java @@ -32,11 +32,13 @@ public abstract class Predicate extends Expr { public Predicate() { super(); + type = Type.BOOLEAN; this.isEqJoinConjunct = false; } protected Predicate(Predicate other) { super(other); + type = other.type; isEqJoinConjunct = other.isEqJoinConjunct; } @@ -50,7 +52,6 @@ public abstract class Predicate extends Expr { @Override protected void analyzeImpl(Analyzer analyzer) throws AnalysisException { - type = Type.BOOLEAN; // values: true/false/null numDistinctValues = 3; }