super(RelOptHelper.any(UnionRel.class, Convention.NONE), "DrillUnionRule");
}
@Override
public void onMatch(RelOptRuleCall call) {
final UnionRel union = (UnionRel) call.rel(0);
final RelTraitSet traits = union.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
final List<RelNode> convertedInputs = new ArrayList<>();
for (RelNode input : union.getInputs()) {
final RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
convertedInputs.add(convertedInput);
}
try {
call.transformTo(new DrillUnionRel(union.getCluster(), traits, convertedInputs, union.all));
} catch (InvalidRelException e) {
tracer.warning(e.toString()) ;
}
}