use of org.apache.calcite.adapter.jdbc.JdbcRules.JdbcSort in project hive by apache.
the class JDBCSortPushDownRule method onMatch.
@Override
public void onMatch(RelOptRuleCall call) {
LOG.debug("JDBCSortPushDownRule has been called");
final HiveSortLimit sort = call.rel(0);
final HiveJdbcConverter converter = call.rel(1);
RelNode node = (sort.fetch != null && RexLiteral.intValue(sort.fetch) == 0) ? new JdbcFilter(sort.getCluster(), sort.getTraitSet().replace(converter.getJdbcConvention()), converter.getInput(), call.builder().literal(false)) : new JdbcSort(sort.getCluster(), sort.getTraitSet().replace(converter.getJdbcConvention()), converter.getInput(), sort.getCollation(), sort.offset, sort.fetch);
call.transformTo(converter.copy(converter.getTraitSet(), node));
}
Aggregations