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

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

## Class UnionColumnVector

- java.lang.Object
- - org.apache.hadoop.hive.ql.exec.vector.ColumnVector
  - - org.apache.hadoop.hive.ql.exec.vector.UnionColumnVector

-     public class UnionColumnVector
      extends ColumnVector

  The representation of a vectorized column of struct objects. Each field is represented by a separate inner ColumnVector. Since this ColumnVector doesn't own any per row data other that the isNull flag, the isRepeating only covers the isNull array.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.exec.vector.ColumnVector

      `ColumnVector.Type`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `ColumnVector[]` | `fields`
    `int[]` | `tags`

    - ### Fields inherited from class org.apache.hadoop.hive.ql.exec.vector.ColumnVector

      `isNull, isRepeating, noNulls`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnionColumnVector()`
    `UnionColumnVector(int len, ColumnVector... fields)` Constructor for UnionColumnVector

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `ensureSize(int size, boolean preserveData)` Ensure the ColumnVector can hold at least size values.
    `void` | `flatten(boolean selectedInUse, int[] sel, int size)`
    `void` | `init()` Initialize the column vector.
    `void` | `reset()` Resets the column to default state - fills the isNull array with false - sets noNulls to true - sets isRepeating to false
    `void` | `setElement(int outElementNum, int inputElementNum, ColumnVector inputVector)` Set the element in this column vector from the given input vector.
    `void` | `setRepeating(boolean isRepeating)` Sets the isRepeating flag.
    `void` | `stringifyValue(StringBuilder buffer, int row)` Print the value for this column into the given string builder.
    `void` | `unFlatten()` Restore the state of isRepeating and noNulls to what it was before flattening.

    - ### Methods inherited from class org.apache.hadoop.hive.ql.exec.vector.ColumnVector

      `flattenNoNulls, flattenPush, flattenRepeatingNulls`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### tags

          public int[] tags

    - #### fields

          public ColumnVector[] fields

  - ### Constructor Detail

    - #### UnionColumnVector

          public UnionColumnVector()

    - #### UnionColumnVector

          public UnionColumnVector(int len,
                                   ColumnVector... fields)

      Constructor for UnionColumnVector
      Parameters:
        `len` - Vector length
        `fields` - the field column vectors

  - ### Method Detail

    - #### flatten

          public void flatten(boolean selectedInUse,
                              int[] sel,
                              int size)

      Specified by:
        `flatten` in class `ColumnVector`

    - #### setElement

          public void setElement(int outElementNum,
                                 int inputElementNum,
                                 ColumnVector inputVector)

      Description copied from class: `ColumnVector`
      Set the element in this column vector from the given input vector. This method can assume that the output does not have isRepeating set.
      Specified by:
        `setElement` in class `ColumnVector`

    - #### stringifyValue

          public void stringifyValue(StringBuilder buffer,
                                     int row)

      Description copied from class: `ColumnVector`
      Print the value for this column into the given string builder.
      Specified by:
        `stringifyValue` in class `ColumnVector`
      Parameters:
        `buffer` - the buffer to print into
        `row` - the id of the row to print

    - #### ensureSize

          public void ensureSize(int size,
                                 boolean preserveData)

      Description copied from class: `ColumnVector`
      Ensure the ColumnVector can hold at least size values. This method is deliberately *not* recursive because the complex types can easily have more (or less) children than the upper levels.
      Overrides:
        `ensureSize` in class `ColumnVector`
      Parameters:
        `size` - the new minimum size
        `preserveData` - should the old data be preserved?

    - #### reset

          public void reset()

      Description copied from class: `ColumnVector`
      Resets the column to default state - fills the isNull array with false - sets noNulls to true - sets isRepeating to false
      Overrides:
        `reset` in class `ColumnVector`

    - #### init

          public void init()

      Description copied from class: `ColumnVector`
      Initialize the column vector. This method can be overridden by specific column vector types. Use this method only if the individual type of the column vector is not known, otherwise its preferable to call specific initialization methods.
      Overrides:
        `init` in class `ColumnVector`

    - #### unFlatten

          public void unFlatten()

      Description copied from class: `ColumnVector`
      Restore the state of isRepeating and noNulls to what it was before flattening. This must only be called just after flattening and then evaluating a VectorExpression on the column vector. It is an optimization that allows other operations on the same column to continue to benefit from the isRepeating and noNulls indicators.
      Overrides:
        `unFlatten` in class `ColumnVector`

    - #### setRepeating

          public void setRepeating(boolean isRepeating)

      Description copied from class: `ColumnVector`
      Sets the isRepeating flag. Recurses over structs and unions so that the flags are set correctly.
      Overrides:
        `setRepeating` in class `ColumnVector`

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