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

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class VectorizedRowBatch
extends Object
implements org.apache.hadoop.io.Writable

A VectorizedRowBatch is a set of rows, organized with each column as a vector. It is the unit of query execution, organized to minimize the cost per row and achieve high cycles-per-instruction. The major fields are public by design to allow fast and convenient access by the vectorized query execution code.


Field Summary
 ColumnVector[] cols
           
static int DEFAULT_SIZE
           
 boolean endOfFile
           
 int numCols
           
 int[] projectedColumns
           
 int projectionSize
           
 int[] selected
           
 boolean selectedInUse
           
 int size
           
 VectorExpressionWriter[] valueWriters
           
 
Constructor Summary
VectorizedRowBatch(int numCols)
          Return a batch with the specified number of columns.
VectorizedRowBatch(int numCols, int size)
          Return a batch with the specified number of columns and rows.
 
Method Summary
 long count()
          Return count of qualifying rows.
 void readFields(DataInput arg0)
           
 void reset()
          Resets the row batch to default state - sets selectedInUse to false - sets size to 0 - sets endOfFile to false - resets each column
 void setValueWriters(VectorExpressionWriter[] valueWriters)
           
 String toString()
           
 void write(DataOutput arg0)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numCols

public int numCols

cols

public ColumnVector[] cols

size

public int size

selected

public int[] selected

projectedColumns

public int[] projectedColumns

projectionSize

public int projectionSize

selectedInUse

public boolean selectedInUse

endOfFile

public boolean endOfFile

DEFAULT_SIZE

public static final int DEFAULT_SIZE
See Also:
Constant Field Values

valueWriters

public VectorExpressionWriter[] valueWriters
Constructor Detail

VectorizedRowBatch

public VectorizedRowBatch(int numCols)
Return a batch with the specified number of columns. This is the standard constructor -- all batches should be the same size

Parameters:
numCols - the number of columns to include in the batch

VectorizedRowBatch

public VectorizedRowBatch(int numCols,
                          int size)
Return a batch with the specified number of columns and rows. Only call this constructor directly for testing purposes. Batch size should normally always be defaultSize.

Parameters:
numCols - the number of columns to include in the batch
size - the number of rows to include in the batch
Method Detail

count

public long count()
Return count of qualifying rows.

Returns:
number of rows that have not been filtered out

toString

public String toString()
Overrides:
toString in class Object

readFields

public void readFields(DataInput arg0)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput arg0)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

setValueWriters

public void setValueWriters(VectorExpressionWriter[] valueWriters)

reset

public void reset()
Resets the row batch to default state - sets selectedInUse to false - sets size to 0 - sets endOfFile to false - resets each column



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