Skip to content

Commit

Permalink
support lookup
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Jin <[email protected]>
  • Loading branch information
LantaoJin committed Dec 25, 2024
1 parent 497bf2c commit 863be2f
Show file tree
Hide file tree
Showing 12 changed files with 663 additions and 245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import org.opensearch.sql.ast.expression.AggregateFunction;
import org.opensearch.sql.ast.expression.Alias;
import org.opensearch.sql.ast.expression.UnresolvedExpression;

import static org.opensearch.sql.calcite.CalciteHelper.translate;
import org.opensearch.sql.calcite.utils.AggregateUtils;

public class CalciteAggCallVisitor extends AbstractNodeVisitor<AggCall, CalcitePlanContext> {
private final CalciteRexNodeVisitor rexNodeVisitor;
Expand All @@ -34,6 +33,6 @@ public AggCall visitAlias(Alias node, CalcitePlanContext context) {
@Override
public AggCall visitAggregateFunction(AggregateFunction node, CalcitePlanContext context) {
RexNode field = rexNodeVisitor.analyze(node.getField(), context);
return translate(node, field, context);
return AggregateUtils.translate(node, field, context);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,23 @@
package org.opensearch.sql.calcite;

import lombok.Getter;
import org.apache.calcite.rex.RexBuilder;
import org.apache.calcite.rex.RexNode;
import org.apache.calcite.tools.FrameworkConfig;
import org.apache.calcite.tools.RelBuilder;
import org.opensearch.sql.ast.expression.UnresolvedExpression;

import java.util.function.BiFunction;

@Getter
public class CalcitePlanContext {

private RelBuilder relBuilder;
private RexBuilder rexBuilder;
public final RelBuilder relBuilder;
public final ExtendedRexBuilder rexBuilder;

private boolean isResolvingJoinCondition = false;
@Getter private boolean isResolvingJoinCondition = false;

public CalcitePlanContext(RelBuilder relBuilder) {
this.relBuilder = relBuilder;
this.rexBuilder = relBuilder.getRexBuilder();
this.rexBuilder = new ExtendedRexBuilder(relBuilder.getRexBuilder());
}

public RexNode resolveJoinCondition(
Expand Down
Loading

0 comments on commit 863be2f

Please sign in to comment.