Java Code Examples for org.apache.calcite.rel.logical.LogicalCorrelate#getCluster()

The following examples show how to use org.apache.calcite.rel.logical.LogicalCorrelate#getCluster() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DrillCorrelateRule.java    From Bats with Apache License 2.0 5 votes vote down vote up
@Override
public void onMatch(RelOptRuleCall call) {
  final LogicalCorrelate correlate = call.rel(0);
  final RelNode left = correlate.getLeft();
  final RelNode right = correlate.getRight();
  final RelNode convertedLeft = convert(left, left.getTraitSet().plus(DrillRel.DRILL_LOGICAL).simplify());
  final RelNode convertedRight = convert(right, right.getTraitSet().plus(DrillRel.DRILL_LOGICAL).simplify());

  final RelTraitSet traits = correlate.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
  DrillLateralJoinRel lateralJoinRel = new DrillLateralJoinRel(correlate.getCluster(),
      traits, convertedLeft, convertedRight, false, correlate.getCorrelationId(),
      correlate.getRequiredColumns(), correlate.getJoinType());
  call.transformTo(lateralJoinRel);
}
 
Example 2
Source File: CorrelateRule.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
@Override
public void onMatch(RelOptRuleCall call) {
  final LogicalCorrelate correlate = call.rel(0);
  final RelTraitSet traits = correlate.getTraitSet().plus(Rel.LOGICAL);
  final RelNode left = correlate.getInput(0);
  final RelNode right = correlate.getInput(1);
  final RelNode convertedLeftInput = convert(left, left.getTraitSet().plus(Rel.LOGICAL).simplify());
  final RelNode convertedRightInput = convert(right, right.getTraitSet().plus(Rel.LOGICAL).simplify());
  CorrelateRel newRel = new CorrelateRel(correlate.getCluster(), traits, convertedLeftInput,
          convertedRightInput, correlate.getCorrelationId(), correlate.getRequiredColumns(), correlate.getJoinType());
  call.transformTo(newRel);
}