Search in sources :

Example 1 with JdbcJoin

use of org.apache.calcite.adapter.jdbc.JdbcRules.JdbcJoin in project drill by apache.

the class PhoenixJoinRule method convert.

@Override
public RelNode convert(RelNode rel) {
    final List<RelNode> newInputs = new ArrayList<>();
    final Join join = (Join) rel;
    for (RelNode input : join.getInputs()) {
        if (input.getConvention() != getOutTrait()) {
            input = convert(input, input.getTraitSet().replace(out));
        }
        newInputs.add(input);
    }
    try {
        JdbcJoin jdbcJoin = new JdbcJoin(join.getCluster(), join.getTraitSet().replace(out), newInputs.get(0), newInputs.get(1), join.getCondition(), join.getVariablesSet(), join.getJoinType());
        return jdbcJoin;
    } catch (InvalidRelException e) {
        return null;
    }
}
Also used : InvalidRelException(org.apache.calcite.rel.InvalidRelException) JdbcJoin(org.apache.calcite.adapter.jdbc.JdbcRules.JdbcJoin) RelNode(org.apache.calcite.rel.RelNode) ArrayList(java.util.ArrayList) LogicalJoin(org.apache.calcite.rel.logical.LogicalJoin) JdbcJoin(org.apache.calcite.adapter.jdbc.JdbcRules.JdbcJoin) Join(org.apache.calcite.rel.core.Join)

Aggregations

ArrayList (java.util.ArrayList)1 JdbcJoin (org.apache.calcite.adapter.jdbc.JdbcRules.JdbcJoin)1 InvalidRelException (org.apache.calcite.rel.InvalidRelException)1 RelNode (org.apache.calcite.rel.RelNode)1 Join (org.apache.calcite.rel.core.Join)1 LogicalJoin (org.apache.calcite.rel.logical.LogicalJoin)1