org.apache.hadoop.hive.ql.udf.ptf
Class TableFunctionEvaluator

java.lang.Object
  extended by org.apache.hadoop.hive.ql.udf.ptf.TableFunctionEvaluator
Direct Known Subclasses:
MatchPath, Noop, WindowingTableFunction

public abstract class TableFunctionEvaluator
extends Object

Based on Hive GenericUDAFEvaluator. Break up the responsibility of the old AsbtractTableFunction class into a Resolver and Evaluator.

The Evaluator also holds onto the TableFunctionDef. This provides information about the arguments to the function, the shape of the Input partition and the Partitioning details. The Evaluator is responsible for providing the 2 execute methods:

  1. execute: which is invoked after the input is partitioned; the contract is, it is given an input Partition and must return an output Partition. The shape of the output Partition is obtained from the getOutputOI call.
  2. transformRawInput: In the case where this function indicates that it will transform the raw input before it is fed through the partitioning mechanics, this function is called. Again the contract is t is given an input Partition and must return an Partition. The shape of the output Partition is obtained from getRawInputOI() call.


Field Summary
protected  StructObjectInspector OI
           
protected  PTFPartition outputPartition
           
protected  PTFDesc ptfDesc
           
protected  StructObjectInspector rawInputOI
           
protected  PTFDesc.PartitionedTableFunctionDef tDef
           
 
Constructor Summary
TableFunctionEvaluator()
           
 
Method Summary
protected  PTFPartition _transformRawInput(PTFPartition iPart)
           
protected abstract  void execute(PTFPartition.PTFPartitionIterator<Object> pItr, PTFPartition oPart)
           
 PTFPartition execute(PTFPartition iPart)
           
 StructObjectInspector getOutputOI()
           
protected  PTFDesc getQueryDef()
           
 StructObjectInspector getRawInputOI()
           
 PTFDesc.PartitionedTableFunctionDef getTableDef()
           
 boolean isTransformsRawInput()
           
protected  void setOutputOI(StructObjectInspector outputOI)
           
protected  void setQueryDef(PTFDesc ptfDesc)
           
protected  void setRawInputOI(StructObjectInspector rawInputOI)
           
 void setTableDef(PTFDesc.PartitionedTableFunctionDef tDef)
           
 void setTransformsRawInput(boolean transformsRawInput)
           
 PTFPartition transformRawInput(PTFPartition iPart)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OI

protected transient StructObjectInspector OI

rawInputOI

protected transient StructObjectInspector rawInputOI

tDef

protected PTFDesc.PartitionedTableFunctionDef tDef

ptfDesc

protected PTFDesc ptfDesc

outputPartition

protected transient PTFPartition outputPartition
Constructor Detail

TableFunctionEvaluator

public TableFunctionEvaluator()
Method Detail

getOutputOI

public StructObjectInspector getOutputOI()

setOutputOI

protected void setOutputOI(StructObjectInspector outputOI)

getTableDef

public PTFDesc.PartitionedTableFunctionDef getTableDef()

setTableDef

public void setTableDef(PTFDesc.PartitionedTableFunctionDef tDef)

getQueryDef

protected PTFDesc getQueryDef()

setQueryDef

protected void setQueryDef(PTFDesc ptfDesc)

getRawInputOI

public StructObjectInspector getRawInputOI()

setRawInputOI

protected void setRawInputOI(StructObjectInspector rawInputOI)

isTransformsRawInput

public boolean isTransformsRawInput()

setTransformsRawInput

public void setTransformsRawInput(boolean transformsRawInput)

execute

public PTFPartition execute(PTFPartition iPart)
                     throws HiveException
Throws:
HiveException

execute

protected abstract void execute(PTFPartition.PTFPartitionIterator<Object> pItr,
                                PTFPartition oPart)
                         throws HiveException
Throws:
HiveException

transformRawInput

public PTFPartition transformRawInput(PTFPartition iPart)
                               throws HiveException
Throws:
HiveException

_transformRawInput

protected PTFPartition _transformRawInput(PTFPartition iPart)
                                   throws HiveException
Throws:
HiveException


Copyright © 2012 The Apache Software Foundation