org.apache.hadoop.hive.ql.ppd
Class ExprWalkerInfo

java.lang.Object
  extended by org.apache.hadoop.hive.ql.ppd.ExprWalkerInfo
All Implemented Interfaces:
NodeProcessorCtx

public class ExprWalkerInfo
extends Object
implements NodeProcessorCtx

Context for Expression Walker for determining predicate pushdown candidates It contains a ExprInfo object for each expression that is processed.


Field Summary
protected static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
ExprWalkerInfo()
           
ExprWalkerInfo(Operator<? extends Serializable> op, RowResolver toRR)
           
 
Method Summary
 void addAlias(exprNodeDesc expr, String alias)
          Adds the specified alias to the specified expr
 void addConvertedNode(exprNodeDesc oldNode, exprNodeDesc newNode)
          adds a replacement node for this expression
 void addFinalCandidate(exprNodeDesc expr)
          Adds the specified expr as the top-most pushdown expr (ie all its children can be pushed)
 String getAlias(exprNodeDesc expr)
          Returns the alias of the specified expr
 exprNodeDesc getConvertedNode(Node nd)
           
 Map<String,List<exprNodeDesc>> getFinalCandidates()
          Returns the list of pushdown expressions for each alias that appear in the current operator's RowResolver.
 Operator<? extends Serializable> getOp()
           
 RowResolver getToRR()
           
 boolean isCandidate(exprNodeDesc expr)
          Returns true if the specified expression is pushdown candidate else false
 boolean isDeterministic()
           
 void merge(ExprWalkerInfo ewi)
          Merges the specified pushdown predicates with the current class
 void setDeterministic(boolean b)
          sets the deterministic flag for this expression
 void setIsCandidate(exprNodeDesc expr, boolean b)
          Marks the specified expr to the specified value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Constructor Detail

ExprWalkerInfo

public ExprWalkerInfo()

ExprWalkerInfo

public ExprWalkerInfo(Operator<? extends Serializable> op,
                      RowResolver toRR)
Method Detail

getOp

public Operator<? extends Serializable> getOp()
Returns:
the op of this expression

getToRR

public RowResolver getToRR()
Returns:
the row resolver of the operator of this expression

getConvertedNode

public exprNodeDesc getConvertedNode(Node nd)
Returns:
converted expression for give node. If there is none then returns null.

addConvertedNode

public void addConvertedNode(exprNodeDesc oldNode,
                             exprNodeDesc newNode)
adds a replacement node for this expression

Parameters:
oldNode - original node
newNode - new node

isCandidate

public boolean isCandidate(exprNodeDesc expr)
Returns true if the specified expression is pushdown candidate else false

Parameters:
expr -
Returns:
true or false

setIsCandidate

public void setIsCandidate(exprNodeDesc expr,
                           boolean b)
Marks the specified expr to the specified value

Parameters:
expr -
b - can

getAlias

public String getAlias(exprNodeDesc expr)
Returns the alias of the specified expr

Parameters:
expr -
Returns:
The alias of the expression

addAlias

public void addAlias(exprNodeDesc expr,
                     String alias)
Adds the specified alias to the specified expr

Parameters:
expr -
alias -

addFinalCandidate

public void addFinalCandidate(exprNodeDesc expr)
Adds the specified expr as the top-most pushdown expr (ie all its children can be pushed)

Parameters:
expr -

getFinalCandidates

public Map<String,List<exprNodeDesc>> getFinalCandidates()
Returns the list of pushdown expressions for each alias that appear in the current operator's RowResolver. The exprs in each list can be combined using conjunction (AND)

Returns:
the map of alias to a list of pushdown predicates

merge

public void merge(ExprWalkerInfo ewi)
Merges the specified pushdown predicates with the current class

Parameters:
ewi - ExpressionWalkerInfo

setDeterministic

public void setDeterministic(boolean b)
sets the deterministic flag for this expression

Parameters:
b - deterministic or not

isDeterministic

public boolean isDeterministic()
Returns:
whether this expression is deterministic or not


Copyright © 2009 The Apache Software Foundation