org.apache.hadoop.hive.ql.optimizer
Class ColumnPruner
java.lang.Object
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). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pGraphContext
protected ParseContext pGraphContext
ColumnPruner
public ColumnPruner()
- empty constructor.
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 © 2013 The Apache Software Foundation