Search in sources :

Example 1 with JdbcAggregate

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

the class JDBCAggregationPushDownRule method onMatch.

@Override
public void onMatch(RelOptRuleCall call) {
    LOG.debug("JDBCAggregationPushDownRule has been called");
    final HiveAggregate aggregate = call.rel(0);
    final HiveJdbcConverter converter = call.rel(1);
    JdbcAggregate jdbcAggregate;
    try {
        jdbcAggregate = new JdbcAggregate(aggregate.getCluster(), aggregate.getTraitSet().replace(converter.getJdbcConvention()), converter.getInput(), aggregate.indicator, aggregate.getGroupSet(), aggregate.getGroupSets(), aggregate.getAggCallList());
    } catch (InvalidRelException e) {
        LOG.warn(e.toString());
        return;
    }
    call.transformTo(converter.copy(converter.getTraitSet(), jdbcAggregate));
}
Also used : InvalidRelException(org.apache.calcite.rel.InvalidRelException) HiveAggregate(org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveAggregate) HiveJdbcConverter(org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter) JdbcAggregate(org.apache.calcite.adapter.jdbc.JdbcRules.JdbcAggregate)

Aggregations

JdbcAggregate (org.apache.calcite.adapter.jdbc.JdbcRules.JdbcAggregate)1 InvalidRelException (org.apache.calcite.rel.InvalidRelException)1 HiveAggregate (org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveAggregate)1 HiveJdbcConverter (org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter)1