@Override public RelNode convert(RelNode rel) { LogicalJoin join = (LogicalJoin) rel; final List<RelNode> newInputs = new ArrayList<>(); for (RelNode input : join.getInputs()) { if (!(input.getConvention() == getOutTrait())) { input = convert(input, input.getTraitSet().replace(out)); } newInputs.add(input); } if (!canJoinOnCondition(join.getCondition())) { return null; } try { return new JdbcJoin( join.getCluster(), join.getTraitSet().replace(out), newInputs.get(0), newInputs.get(1), join.getCondition(), join.getVariablesSet(), join.getJoinType()); } catch (InvalidRelException e) { LOGGER.fine(e.toString()); return null; } }
public RelNode convert(RelNode rel) { final LogicalAggregate agg = (LogicalAggregate) rel; if (agg.getGroupSets().size() != 1) { // GROUPING SETS not supported; see // [CALCITE-734] Push GROUPING SETS to underlying SQL via JDBC adapter return null; } final RelTraitSet traitSet = agg.getTraitSet().replace(out); try { return new JdbcAggregate( rel.getCluster(), traitSet, convert(agg.getInput(), out), agg.indicator, agg.getGroupSet(), agg.getGroupSets(), agg.getAggCallList()); } catch (InvalidRelException e) { LOGGER.fine(e.toString()); return null; } }