This is an automated email from the ASF dual-hosted git repository. morrysnow pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 849adca225 [fix](Nereids) expressions is not be extracted when binding function (#15361) 849adca225 is described below commit 849adca2255ffc2c5204207e2c277feb1dbc7e18 Author: mch_ucchi <41606806+sohardforan...@users.noreply.github.com> AuthorDate: Tue Dec 27 17:12:07 2022 +0800 [fix](Nereids) expressions is not be extracted when binding function (#15361) --- .../doris/nereids/rules/analysis/BindFunction.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindFunction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindFunction.java index aa1f35bb38..387409753c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindFunction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindFunction.java @@ -49,10 +49,10 @@ import org.apache.doris.nereids.trees.plans.logical.LogicalSort; import org.apache.doris.nereids.trees.plans.logical.LogicalTVFRelation; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; import java.util.List; import java.util.Locale; +import java.util.Set; import java.util.stream.Collectors; /** @@ -102,15 +102,15 @@ public class BindFunction implements AnalysisRuleFactory { RuleType.BINDING_FILTER_FUNCTION.build( logicalFilter().thenApply(ctx -> { LogicalFilter<GroupPlan> filter = ctx.root; - List<Expression> conjuncts = bind(filter.getExpressions(), ctx.connectContext.getEnv()); - return new LogicalFilter<>(ImmutableSet.copyOf(conjuncts), filter.child()); + Set<Expression> conjuncts = bind(filter.getConjuncts(), ctx.connectContext.getEnv()); + return new LogicalFilter<>(conjuncts, filter.child()); }) ), RuleType.BINDING_HAVING_FUNCTION.build( logicalHaving().thenApply(ctx -> { LogicalHaving<GroupPlan> having = ctx.root; - List<Expression> conjuncts = bind(having.getExpressions(), ctx.connectContext.getEnv()); - return new LogicalHaving<>(ImmutableSet.copyOf(conjuncts), having.child()); + Set<Expression> conjuncts = bind(having.getConjuncts(), ctx.connectContext.getEnv()); + return new LogicalHaving<>(conjuncts, having.child()); }) ), RuleType.BINDING_SORT_FUNCTION.build( @@ -151,6 +151,12 @@ public class BindFunction implements AnalysisRuleFactory { .collect(Collectors.toList()); } + private <E extends Expression> Set<E> bind(Set<? extends E> exprSet, Env env) { + return exprSet.stream() + .map(expr -> FunctionBinder.INSTANCE.bind(expr, env)) + .collect(Collectors.toSet()); + } + /** * function binder */ --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org