morrySnow commented on code in PR #21998: URL: https://github.com/apache/doris/pull/21998#discussion_r1269256485
########## fe/fe-core/src/main/java/org/apache/doris/planner/external/ExternalScanNode.java: ########## @@ -42,6 +46,8 @@ public abstract class ExternalScanNode extends ScanNode { // set to false means this scan node does not need to check column priv. protected boolean needCheckColumnPriv; + private Set<Expression> nereidsConjuncts; + private PlanTranslatorContext context; Review Comment: scannode should not have a PlanTranslatorContext attr ########## fe/fe-core/src/main/java/org/apache/doris/planner/external/ExternalScanNode.java: ########## @@ -42,6 +46,8 @@ public abstract class ExternalScanNode extends ScanNode { // set to false means this scan node does not need to check column priv. protected boolean needCheckColumnPriv; + private Set<Expression> nereidsConjuncts; Review Comment: nereidsConjuncts is a bad name, please rename it to something more meaningful ########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/TranslateJdbcConjuncts.java: ########## @@ -0,0 +1,39 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.nereids.rules.rewrite; + +import org.apache.doris.nereids.rules.Rule; +import org.apache.doris.nereids.rules.RuleType; +import org.apache.doris.nereids.trees.plans.logical.LogicalFilter; +import org.apache.doris.nereids.trees.plans.logical.LogicalJdbcScan; + +/** + * Rewrite jdbc plan to set the conjuncts. + */ +public class TranslateJdbcConjuncts extends OneRewriteRuleFactory { Review Comment: rename to `PushConjunctsIntoJdbcScan` ########## fe/fe-core/src/main/java/org/apache/doris/planner/external/ExternalScanNode.java: ########## @@ -90,4 +97,20 @@ public boolean needToCheckColumnPriv() { public int getNumInstances() { return scanRangeLocations.size(); } + + public void setNereidsConjuncts(Set<Expression> conjuncts) { + this.nereidsConjuncts = conjuncts; + } + + public void setContext(PlanTranslatorContext context) { + this.context = context; + } + + private void translateConjuncts() { + if (nereidsConjuncts != null) { + nereidsConjuncts.stream() + .map(e -> ExpressionTranslator.translate(e, context)) + .forEach(conjuncts::add); + } Review Comment: u should tranlate in PhysicalPlanTranslator and set legacy planner's expr(List<Expr>)to this node ########## fe/fe-core/src/main/java/org/apache/doris/planner/external/ExternalScanNode.java: ########## @@ -90,4 +97,20 @@ public boolean needToCheckColumnPriv() { public int getNumInstances() { return scanRangeLocations.size(); } + + public void setNereidsConjuncts(Set<Expression> conjuncts) { + this.nereidsConjuncts = conjuncts; + } + + public void setContext(PlanTranslatorContext context) { + this.context = context; + } + + private void translateConjuncts() { + if (nereidsConjuncts != null) { + nereidsConjuncts.stream() + .map(e -> ExpressionTranslator.translate(e, context)) + .forEach(conjuncts::add); + } Review Comment: u should tranlate in PhysicalPlanTranslator and set legacy planner's expr(List<Expr>)to this node -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org