@Override public RelNode convert(RelNode rel) { final Window window = (Window) rel; final RelTraitSet traitSet = window.getTraitSet().replace(OLAPRel.CONVENTION); final RelNode input = window.getInput(); return new OLAPWindowRel(rel.getCluster(), traitSet, convert(input, input.getTraitSet().replace(OLAPRel.CONVENTION)), window.constants, window.getRowType(), window.groups); } }
@Override public RelNode convert(RelNode rel) { final Window window = (Window) rel; final RelTraitSet traitSet = window.getTraitSet().replace(OLAPRel.CONVENTION); final RelNode input = window.getInput(); return new OLAPWindowRel(rel.getCluster(), traitSet, convert(input, input.getTraitSet().replace(OLAPRel.CONVENTION)), window.constants, window.getRowType(), window.groups); } }
@Override public void onMatch(RelOptRuleCall call) { final Window window = call.rel(0); final RelNode input = call.rel(1); final RelTraitSet traits = window.getTraitSet().plus(Rel.LOGICAL); final RelNode convertedInput = convert(input, traits.simplify()); call.transformTo( new WindowRel( window.getCluster(), traits, convertedInput, window.constants, window.getRowType(), window.groups)); } }
@Override public void onMatch(RelOptRuleCall call) { final Window window = call.rel(0); final RelNode input = call.rel(1); final RelTraitSet traits = window.getTraitSet().plus(DrillRel.DRILL_LOGICAL).simplify(); final RelNode convertedInput = convert(input, traits); call.transformTo( new DrillWindowRel( window.getCluster(), traits, convertedInput, window.constants, window.getRowType(), window.groups)); } }