org.apache.hadoop.hive.ql.optimizer.index
Class RewriteGBUsingIndex

java.lang.Object
  extended by org.apache.hadoop.hive.ql.optimizer.index.RewriteGBUsingIndex
All Implemented Interfaces:
Transform

public class RewriteGBUsingIndex
extends Object
implements Transform

RewriteGBUsingIndex is implemented as one of the Rule-based Optimizations. Implements optimizations for GroupBy clause rewrite using aggregate index. This optimization rewrites GroupBy query over base table to the query over simple table-scan over index table, if there is index on the group by key(s) or the distinct column(s). E.g. select count(key) from table group by key; to select sum(_count_of_key) from idx_table group by key; The rewrite supports following queries:

See Also:
AggregateIndexHandler, IndexUtils, RewriteCanApplyCtx, RewriteCanApplyProcFactory, RewriteParseContextGenerator, RewriteQueryUsingAggregateIndexCtx, For test cases, @see ql_rewrite_gbtoidx.q

Constructor Summary
RewriteGBUsingIndex()
           
 
Method Summary
 ParseContext transform(ParseContext pctx)
          All transformation steps implement this interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RewriteGBUsingIndex

public RewriteGBUsingIndex()
Method Detail

transform

public ParseContext transform(ParseContext pctx)
                       throws SemanticException
Description copied from interface: Transform
All transformation steps implement this interface.

Specified by:
transform in interface Transform
Parameters:
pctx - input parse context
Returns:
ParseContext
Throws:
SemanticException


Copyright © 2014 The Apache Software Foundation. All rights reserved.