org.apache.hadoop.hive.ql.optimizer
Class ColumnPruner

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

public class ColumnPruner
extends Object
implements Transform

Implementation of one of the rule-based optimization steps. ColumnPruner gets the current operator tree. The \ tree is traversed to find out the columns used for all the base tables. If all the columns for a table are not used, a select is pushed on top of that table (to select only those columns). Since this changes the row resolver, the tree is built again. This can be optimized later to patch the tree.


Nested Class Summary
static class ColumnPruner.ColumnPrunerWalker
          Walks the op tree in post order fashion (skips selects with file sink or script op children).
 
Constructor Summary
ColumnPruner()
          empty constructor.
 
Method Summary
 ParseContext transform(ParseContext pactx)
          Transform the query tree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnPruner

public ColumnPruner()
empty constructor.

Method Detail

transform

public ParseContext transform(ParseContext pactx)
                       throws SemanticException
Transform the query tree. For each table under consideration, check if all columns are needed. If not, only select the operators needed at the beginning and proceed.

Specified by:
transform in interface Transform
Parameters:
pactx - the current parse context
Returns:
ParseContext
Throws:
SemanticException


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