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

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

public class PartitionPruner
extends Object


Nested Class Summary
static class PartitionPruner.PrunedPartitionList
          list of the partitions satisfying the pruning criteria - contains both confirmed and unknown partitions
 
Constructor Summary
PartitionPruner(String tableAlias, QBMetaData metaData)
          Creates a new instance of PartitionPruner
 
Method Summary
 void addExpression(ASTNode expr)
          Add an expression
 void addJoinOnExpression(ASTNode expr)
          Add an expression from the JOIN condition.
 boolean containsPartitionCols()
           
 Table getTable()
           
 boolean hasPartitionPredicate(ASTNode expr)
           
static boolean mightBeUnknown(exprNodeDesc desc)
           
 PartitionPruner.PrunedPartitionList prune()
          From the table metadata prune the partitions to return the partitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartitionPruner

public PartitionPruner(String tableAlias,
                       QBMetaData metaData)
Creates a new instance of PartitionPruner

Method Detail

containsPartitionCols

public boolean containsPartitionCols()

mightBeUnknown

public static boolean mightBeUnknown(exprNodeDesc desc)

hasPartitionPredicate

public boolean hasPartitionPredicate(ASTNode expr)

addExpression

public void addExpression(ASTNode expr)
                   throws SemanticException
Add an expression

Throws:
SemanticException

addJoinOnExpression

public void addJoinOnExpression(ASTNode expr)
                         throws SemanticException
Add an expression from the JOIN condition. Since these expressions will be used for all the where clauses, they are always ANDed. Then we walk through the remaining filters (in the where clause) and OR them with the existing condition.

Throws:
SemanticException

prune

public PartitionPruner.PrunedPartitionList prune()
                                          throws HiveException
From the table metadata prune the partitions to return the partitions. Evaluate the parition pruner for each partition and return confirmed and unknown partitions separately

Throws:
HiveException

getTable

public Table getTable()


Copyright © 2009 The Apache Software Foundation