org.apache.hadoop.hive.ql.optimizer.ppr
Class PartitionPruner

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

public class PartitionPruner
extends Object
implements Transform

The transformation step that does partition pruning.


Constructor Summary
PartitionPruner()
           
 
Method Summary
static boolean hasColumnExpr(exprNodeDesc desc)
          Whether the expression contains a column node or not.
static boolean onlyContainsPartnCols(Table tab, exprNodeDesc expr)
          Find out whether the condition only contains partitioned columns.
static PrunedPartitionList prune(Table tab, exprNodeDesc prunerExpr, HiveConf conf, String alias, Map<String,PrunedPartitionList> prunedPartitionsMap)
          Get the partition list for the table that satisfies the partition pruner condition.
 ParseContext transform(ParseContext pctx)
          All transformation steps implement this interface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartitionPruner

public PartitionPruner()
Method Detail

transform

public ParseContext transform(ParseContext pctx)
                       throws SemanticException
Description copied from interface: Transform
All transformation steps implement this interface

Specified by:
transform in interface Transform
Parameters:
pctx - input parse context
Returns:
ParseContext
Throws:
SemanticException

onlyContainsPartnCols

public static boolean onlyContainsPartnCols(Table tab,
                                            exprNodeDesc expr)
Find out whether the condition only contains partitioned columns. Note that if the table is not partitioned, the function always returns true. condition.

Parameters:
tab - the table object
expr - the pruner expression for the table

prune

public static PrunedPartitionList prune(Table tab,
                                        exprNodeDesc prunerExpr,
                                        HiveConf conf,
                                        String alias,
                                        Map<String,PrunedPartitionList> prunedPartitionsMap)
                                 throws HiveException
Get the partition list for the table that satisfies the partition pruner condition.

Parameters:
tab - the table object for the alias
prunerExpr - the pruner expression for the alias
conf - for checking whether "strict" mode is on.
alias - for generating error message only.
Returns:
the partition list for the table that satisfies the partition pruner condition.
Throws:
HiveException

hasColumnExpr

public static boolean hasColumnExpr(exprNodeDesc desc)
Whether the expression contains a column node or not.



Copyright © 2009 The Apache Software Foundation