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

java.lang.Object
  extended by org.apache.hadoop.hive.ql.optimizer.PrunerExpressionOperatorFactory
      extended by org.apache.hadoop.hive.ql.optimizer.ppr.ExprProcFactory

public final class ExprProcFactory
extends PrunerExpressionOperatorFactory

Expression processor factory for partition pruning. Each processor tries to convert the expression subtree into a partition pruning expression. This expression is then used to figure out whether a particular partition should be scanned or not. * Refactor: Move main logic to PrunerExpressionOperatorFactory. ExprProcFactory extends it to reuse logic. Any other pruner can reuse it by creating a class extending from PrunerExpressionOperatorFactory. Only specific logic is in genPruner(..) which is in its own class like ExprProcFactory.


Nested Class Summary
static class ExprProcFactory.PPRColumnExprProcessor
          Processor for ppr column expressions.
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.optimizer.PrunerExpressionOperatorFactory
PrunerExpressionOperatorFactory.ColumnExprProcessor, PrunerExpressionOperatorFactory.DefaultExprProcessor, PrunerExpressionOperatorFactory.FieldExprProcessor, PrunerExpressionOperatorFactory.GenericFuncExprProcessor
 
Method Summary
static ExprNodeDesc genPruner(String tabAlias, ExprNodeDesc pred)
          Generates the partition pruner for the expression tree.
static NodeProcessor getColumnProcessor()
          Instantiate column processor.
 
Methods inherited from class org.apache.hadoop.hive.ql.optimizer.PrunerExpressionOperatorFactory
getDefaultExprProcessor, getFieldProcessor, getGenericFuncProcessor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getColumnProcessor

public static NodeProcessor getColumnProcessor()
Instantiate column processor.

Returns:

genPruner

public static ExprNodeDesc genPruner(String tabAlias,
                                     ExprNodeDesc pred)
                              throws SemanticException
Generates the partition pruner for the expression tree.

Parameters:
tabAlias - The table alias of the partition table that is being considered for pruning
pred - The predicate from which the partition pruner needs to be generated
Returns:
The pruner expression.
Throws:
SemanticException


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