Search in sources :

Example 16 with HiveSortLimit

use of org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveSortLimit in project hive by apache.

the class HiveFilterSortTransposeRule method onMatch.

public void onMatch(RelOptRuleCall call) {
    final HiveFilter filter = call.rel(0);
    final HiveSortLimit sort = call.rel(1);
    final RelNode newFilter = filter.copy(sort.getInput().getTraitSet(), ImmutableList.<RelNode>of(sort.getInput()));
    final HiveSortLimit newSort = sort.copy(sort.getTraitSet(), newFilter, sort.collation, sort.offset, sort.fetch);
    call.transformTo(newSort);
}
Also used : RelNode(org.apache.calcite.rel.RelNode) HiveSortLimit(org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveSortLimit) HiveFilter(org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveFilter)

Aggregations

HiveSortLimit (org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveSortLimit)16 RelNode (org.apache.calcite.rel.RelNode)7 RelFieldCollation (org.apache.calcite.rel.RelFieldCollation)4 RelCollation (org.apache.calcite.rel.RelCollation)3 RexNode (org.apache.calcite.rex.RexNode)3 HiveProject (org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveProject)3 HiveJoin (org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin)2 HiveUnion (org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveUnion)2 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 JdbcFilter (org.apache.calcite.adapter.jdbc.JdbcRules.JdbcFilter)1 JdbcSort (org.apache.calcite.adapter.jdbc.JdbcRules.JdbcSort)1 RelOptCluster (org.apache.calcite.plan.RelOptCluster)1 RelTraitSet (org.apache.calcite.plan.RelTraitSet)1 Project (org.apache.calcite.rel.core.Project)1 Sort (org.apache.calcite.rel.core.Sort)1 RelMetadataQuery (org.apache.calcite.rel.metadata.RelMetadataQuery)1 RelDataType (org.apache.calcite.rel.type.RelDataType)1