org.apache.hadoop.hive.ql.exec.vector
Class VectorizationContext

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.vector.VectorizationContext

public class VectorizationContext
extends Object

Context class for vectorization execution. Main role is to map column names to column indices and serves as a factory class for building vectorized expressions out of descriptors.


Field Summary
static Pattern decimalTypePattern
           
 
Constructor Summary
VectorizationContext(Map<String,Integer> columnMap, int initialOutputCol)
           
VectorizationContext(VectorizationContext parent)
          This constructor inherits the OutputColumnManger and from the 'parent' constructor, therefore this should be used only by operators that don't create a new vectorized row batch.
 
Method Summary
 void addToColumnMap(String columnName, int outputColumn)
           
static String arg0Type(ExprNodeGenericFuncDesc expr)
           
 VectorAggregateExpression getAggregatorExpression(AggregationDesc desc)
           
 Map<String,Integer> getColumnMap()
           
 String getFileKey()
           
 Map<Integer,String> getOutputColumnTypeMap()
           
 VectorExpression getVectorExpression(ExprNodeDesc exprDesc)
           
 VectorExpression getVectorExpression(ExprNodeDesc exprDesc, VectorExpressionDescriptor.Mode mode)
          Returns a vector expression for a given expression description.
 VectorExpression[] getVectorExpressions(List<ExprNodeDesc> exprNodes)
           
 VectorExpression[] getVectorExpressions(List<ExprNodeDesc> exprNodes, VectorExpressionDescriptor.Mode mode)
           
static boolean isCastToFloatFamily(Class<? extends UDF> udfClass)
           
static boolean isCastToIntFamily(Class<? extends UDF> udfClass)
           
static boolean isCustomUDF(ExprNodeGenericFuncDesc expr)
           
static boolean isDateFamily(String resultType)
           
static boolean isDatetimeFamily(String resultType)
           
static boolean isDecimalFamily(String colType)
           
static boolean isFloatFamily(String resultType)
           
static boolean isIntFamily(String resultType)
           
static boolean isNonVectorizedPathUDF(ExprNodeGenericFuncDesc expr)
           
static boolean isStringFamily(String resultType)
           
static boolean isTimestampFamily(String resultType)
           
 void setFileKey(String fileKey)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decimalTypePattern

public static final Pattern decimalTypePattern
Constructor Detail

VectorizationContext

public VectorizationContext(Map<String,Integer> columnMap,
                            int initialOutputCol)

VectorizationContext

public VectorizationContext(VectorizationContext parent)
This constructor inherits the OutputColumnManger and from the 'parent' constructor, therefore this should be used only by operators that don't create a new vectorized row batch. This should be used only by operators that want to modify the columnName map without changing the row batch.

Method Detail

getFileKey

public String getFileKey()

setFileKey

public void setFileKey(String fileKey)

getVectorExpressions

public VectorExpression[] getVectorExpressions(List<ExprNodeDesc> exprNodes)
                                        throws HiveException
Throws:
HiveException

getVectorExpressions

public VectorExpression[] getVectorExpressions(List<ExprNodeDesc> exprNodes,
                                               VectorExpressionDescriptor.Mode mode)
                                        throws HiveException
Throws:
HiveException

getVectorExpression

public VectorExpression getVectorExpression(ExprNodeDesc exprDesc)
                                     throws HiveException
Throws:
HiveException

getVectorExpression

public VectorExpression getVectorExpression(ExprNodeDesc exprDesc,
                                            VectorExpressionDescriptor.Mode mode)
                                     throws HiveException
Returns a vector expression for a given expression description.

Parameters:
exprDesc, - Expression description
mode -
Returns:
VectorExpression
Throws:
HiveException

isNonVectorizedPathUDF

public static boolean isNonVectorizedPathUDF(ExprNodeGenericFuncDesc expr)

isCastToIntFamily

public static boolean isCastToIntFamily(Class<? extends UDF> udfClass)

isCastToFloatFamily

public static boolean isCastToFloatFamily(Class<? extends UDF> udfClass)

arg0Type

public static String arg0Type(ExprNodeGenericFuncDesc expr)

isCustomUDF

public static boolean isCustomUDF(ExprNodeGenericFuncDesc expr)

isStringFamily

public static boolean isStringFamily(String resultType)

isDatetimeFamily

public static boolean isDatetimeFamily(String resultType)

isTimestampFamily

public static boolean isTimestampFamily(String resultType)

isDateFamily

public static boolean isDateFamily(String resultType)

isFloatFamily

public static boolean isFloatFamily(String resultType)

isIntFamily

public static boolean isIntFamily(String resultType)

isDecimalFamily

public static boolean isDecimalFamily(String colType)

getAggregatorExpression

public VectorAggregateExpression getAggregatorExpression(AggregationDesc desc)
                                                  throws HiveException
Throws:
HiveException

getOutputColumnTypeMap

public Map<Integer,String> getOutputColumnTypeMap()

getColumnMap

public Map<String,Integer> getColumnMap()

addToColumnMap

public void addToColumnMap(String columnName,
                           int outputColumn)
                    throws HiveException
Throws:
HiveException


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