org.apache.hadoop.hive.ql.parse
Class TableAccessAnalyzer

java.lang.Object
  extended by org.apache.hadoop.hive.ql.parse.TableAccessAnalyzer

public class TableAccessAnalyzer
extends Object

TableAccessAnalyzer walks the operator graph from joins and group bys to the table scan operator backing it. It checks whether the operators in the path are pass-through of the base table (no aggregations/joins), and if the keys are mapped by expressions that do not modify the bucket for the key. If all the keys for a join/group by are clean pass-through of the base table columns, we can consider this operator as a candidate for improvement through bucketing.


Nested Class Summary
 class TableAccessAnalyzer.GroupByProcessor
          Processor for GroupBy operator
 class TableAccessAnalyzer.JoinProcessor
          Processor for Join operator.
 
Constructor Summary
TableAccessAnalyzer()
           
TableAccessAnalyzer(ParseContext pactx)
           
 
Method Summary
 TableAccessInfo analyzeTableAccess()
           
static TableScanOperator genRootTableScan(Operator<? extends OperatorDesc> op, List<String> keyNames)
          This method traces up from the given operator to the root of the operator graph until a TableScanOperator is reached.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableAccessAnalyzer

public TableAccessAnalyzer()

TableAccessAnalyzer

public TableAccessAnalyzer(ParseContext pactx)
Method Detail

analyzeTableAccess

public TableAccessInfo analyzeTableAccess()
                                   throws SemanticException
Throws:
SemanticException

genRootTableScan

public static TableScanOperator genRootTableScan(Operator<? extends OperatorDesc> op,
                                                 List<String> keyNames)
This method traces up from the given operator to the root of the operator graph until a TableScanOperator is reached. Along the way, if any operators are present that do not provide a direct mapping from columns of the base table to the keys on the input operator, the trace-back is stopped at that point. If the trace back can be done successfully, the method returns the root TableScanOperator as well as the list of column names on that table that map to the keys used for the input operator (which is currently only a join or group by).



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