VectorizedRowBatch (Hive Storage API 2.1.1-pre-orc API)
Date: 2016-10-19

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

## Class VectorizedRowBatch

- java.lang.Object
- - 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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `ColumnVector[]` | `cols`
    `static int` | `DEFAULT_SIZE`
    `boolean` | `endOfFile`
    `int` | `numCols`
    `int[]` | `projectedColumns`
    `int` | `projectionSize`
    `int[]` | `selected`
    `boolean` | `selectedInUse`
    `int` | `size`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `count()` Return count of qualifying rows.
    `void` | `ensureSize(int rows)` Set the maximum number of rows in the batch.
    `int` | `getDataColumnCount()`
    `int` | `getMaxSize()` Returns the maximum size of the batch (number of rows it can hold)
    `int` | `getPartitionColumnCount()`
    `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 - inits each column
    `void` | `setPartitionInfo(int dataColumnCount, int partitionColumnCount)`
    `String` | `toString()`
    `void` | `write(DataOutput arg0)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, 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

  - ### 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

    - #### setPartitionInfo

          public void setPartitionInfo(int dataColumnCount,
                                       int partitionColumnCount)

    - #### getDataColumnCount

          public int getDataColumnCount()

    - #### getPartitionColumnCount

          public int getPartitionColumnCount()

    - #### getMaxSize

          public int getMaxSize()

      Returns the maximum size of the batch (number of rows it can hold)

    - #### 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`

    - #### 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 - inits each column

    - #### ensureSize

          public void ensureSize(int rows)

      Set the maximum number of rows in the batch. Data is not preserved.

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