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

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

public class VectorHashKeyWrapperBatch
extends Object

Class for handling vectorized hash map key wrappers. It evaluates the key columns in a row batch in a vectorized fashion. This class stores additional information about keys needed to evaluate and output the key values.


Constructor Summary
VectorHashKeyWrapperBatch()
           
 
Method Summary
 VectorHashKeyWrapper allocateKeyWrapper()
           
static VectorHashKeyWrapperBatch compileKeyWrapperBatch(VectorExpression[] keyExpressions)
          Prepares a VectorHashKeyWrapperBatch to work for a specific set of keys.
 void evaluateBatch(VectorizedRowBatch batch)
          Processes a batch: Evaluates each key vector expression. Copies out each key's primitive values into the key wrappers computes the hashcode of the key wrappers
 int getKeysFixedSize()
          Returns the compiled fixed size for the key wrappers.
 int getVariableSize(int batchSize)
           
 VectorHashKeyWrapper[] getVectorHashKeyWrappers()
          Accessor for the batch-sized array of key wrappers.
 Object getWritableKeyValue(VectorHashKeyWrapper kw, int i, VectorExpressionWriter keyOutputWriter)
          Get the row-mode writable object value of a key from a key wrapper
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorHashKeyWrapperBatch

public VectorHashKeyWrapperBatch()
Method Detail

getKeysFixedSize

public int getKeysFixedSize()
Returns the compiled fixed size for the key wrappers.

Returns:

getVectorHashKeyWrappers

public VectorHashKeyWrapper[] getVectorHashKeyWrappers()
Accessor for the batch-sized array of key wrappers.


evaluateBatch

public void evaluateBatch(VectorizedRowBatch batch)
                   throws HiveException
Processes a batch:

Parameters:
batch -
Throws:
HiveException

compileKeyWrapperBatch

public static VectorHashKeyWrapperBatch compileKeyWrapperBatch(VectorExpression[] keyExpressions)
                                                        throws HiveException
Prepares a VectorHashKeyWrapperBatch to work for a specific set of keys. Computes the fast access lookup indices, preallocates all needed internal arrays. This step is done only once per query, not once per batch. The information computed now will be used to generate proper individual VectorKeyHashWrapper objects.

Throws:
HiveException

allocateKeyWrapper

public VectorHashKeyWrapper allocateKeyWrapper()

getWritableKeyValue

public Object getWritableKeyValue(VectorHashKeyWrapper kw,
                                  int i,
                                  VectorExpressionWriter keyOutputWriter)
                           throws HiveException
Get the row-mode writable object value of a key from a key wrapper

Parameters:
keyOutputWriter -
Throws:
HiveException

getVariableSize

public int getVariableSize(int batchSize)


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