public void onMatch(RelOptRuleCall call) { final LogicalCorrelate correlate = call.rel(0); final RelNode left = call.rel(1); final LogicalProject aggOutputProject; final LogicalAggregate aggregate; if (flavor) { aggOutputProject = call.rel(2); aggregate = call.rel(3); } else { aggregate = call.rel(2); // Create identity projection final List<Pair<RexNode, String>> projects = new ArrayList<>(); final List<RelDataTypeField> fields = aggregate.getRowType().getFieldList(); for (int i = 0; i < fields.size(); i++) { projects.add(RexInputRef.of2(projects.size(), fields)); } final RelBuilder relBuilder = call.builder(); relBuilder.push(aggregate) .projectNamed(Pair.left(projects), Pair.right(projects), true); aggOutputProject = (LogicalProject) relBuilder.build(); } onMatch2(call, correlate, left, aggOutputProject, aggregate); }
public void onMatch(RelOptRuleCall call) { final LogicalCorrelate correlate = call.rel(0); final RelNode left = call.rel(1); final LogicalProject aggOutputProject; final LogicalAggregate aggregate; if (flavor) { aggOutputProject = call.rel(2); aggregate = call.rel(3); } else { aggregate = call.rel(2); // Create identity projection final List<Pair<RexNode, String>> projects = new ArrayList<>(); final List<RelDataTypeField> fields = aggregate.getRowType().getFieldList(); for (int i = 0; i < fields.size(); i++) { projects.add(RexInputRef.of2(projects.size(), fields)); } final RelBuilder relBuilder = call.builder(); relBuilder.push(aggregate) .projectNamed(Pair.left(projects), Pair.right(projects), true); aggOutputProject = (LogicalProject) relBuilder.build(); } onMatch2(call, correlate, left, aggOutputProject, aggregate); }
public void onMatch(RelOptRuleCall call) { final LogicalCorrelate correlate = call.rel(0); final RelNode left = call.rel(1); final LogicalProject aggOutputProject; final LogicalAggregate aggregate; if (flavor) { aggOutputProject = call.rel(2); aggregate = call.rel(3); } else { aggregate = call.rel(2); // Create identity projection final List<Pair<RexNode, String>> projects = Lists.newArrayList(); final List<RelDataTypeField> fields = aggregate.getRowType().getFieldList(); for (int i = 0; i < fields.size(); i++) { projects.add(RexInputRef.of2(projects.size(), fields)); } final RelBuilder relBuilder = call.builder(); relBuilder.push(aggregate) .projectNamed(Pair.left(projects), Pair.right(projects), true); aggOutputProject = (LogicalProject) relBuilder.build(); } onMatch2(call, correlate, left, aggOutputProject, aggregate); }