Skip to content

Commit 8568c2f

Browse files
committed
address comments from peng
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
1 parent 3dc994b commit 8568c2f

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,6 @@ public RelNode visitPatterns(Patterns node, CalcitePlanContext context) {
858858
@Override
859859
public RelNode visitEval(Eval node, CalcitePlanContext context) {
860860
visitChildren(node, context);
861-
862861
node.getExpressionList()
863862
.forEach(
864863
expr -> {
@@ -2246,10 +2245,9 @@ private RelNode mergeTableAndResolveColumnConflict(
22462245
@Override
22472246
public RelNode visitMultisearch(Multisearch node, CalcitePlanContext context) {
22482247
List<RelNode> subsearchNodes = new ArrayList<>();
2249-
22502248
for (UnresolvedPlan subsearch : node.getSubsearches()) {
22512249
UnresolvedPlan prunedSubSearch = subsearch.accept(new EmptySourcePropagateVisitor(), null);
2252-
analyze(prunedSubSearch, context);
2250+
prunedSubSearch.accept(this, context);
22532251
subsearchNodes.add(context.relBuilder.build());
22542252
}
22552253

core/src/main/java/org/opensearch/sql/executor/QueryService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
@AllArgsConstructor
5757
@Log4j2
5858
public class QueryService {
59+
private static final HepProgram FILTER_MERGE_PROGRAM =
60+
new HepProgramBuilder().addRuleInstance(FilterMergeRule.Config.DEFAULT.toRule()).build();
61+
5962
private final Analyzer analyzer;
6063
private final ExecutionEngine executionEngine;
6164
private final Planner planner;
@@ -270,9 +273,7 @@ public RelNode analyze(UnresolvedPlan plan, CalcitePlanContext context) {
270273
* the rest of optimization.
271274
*/
272275
private RelNode mergeAdjacentFilters(RelNode relNode) {
273-
HepProgram program =
274-
new HepProgramBuilder().addRuleInstance(FilterMergeRule.Config.DEFAULT.toRule()).build();
275-
HepPlanner planner = new HepPlanner(program);
276+
HepPlanner planner = new HepPlanner(FILTER_MERGE_PROGRAM);
276277
planner.setRoot(relNode);
277278
return planner.findBestExp();
278279
}

0 commit comments

Comments
 (0)