Search in sources :

Example 1 with JdbcUnion

use of org.apache.calcite.adapter.jdbc.JdbcRules.JdbcUnion in project hive by apache.

the class JDBCUnionPushDownRule method onMatch.

@Override
public void onMatch(RelOptRuleCall call) {
    LOG.debug("JDBCUnionPushDown has been called");
    final HiveUnion union = call.rel(0);
    final HiveJdbcConverter converter1 = call.rel(1);
    final HiveJdbcConverter converter2 = call.rel(2);
    List<RelNode> unionInput = Arrays.asList(converter1.getInput(), converter2.getInput());
    JdbcUnion jdbcUnion = new JdbcUnion(union.getCluster(), union.getTraitSet().replace(converter1.getJdbcConvention()), unionInput, union.all);
    call.transformTo(converter1.copy(converter1.getTraitSet(), jdbcUnion));
}
Also used : RelNode(org.apache.calcite.rel.RelNode) JdbcUnion(org.apache.calcite.adapter.jdbc.JdbcRules.JdbcUnion) HiveJdbcConverter(org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter) HiveUnion(org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveUnion)

Aggregations

JdbcUnion (org.apache.calcite.adapter.jdbc.JdbcRules.JdbcUnion)1 RelNode (org.apache.calcite.rel.RelNode)1 HiveUnion (org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveUnion)1 HiveJdbcConverter (org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter)1