Interface UnionShim

All Superinterfaces:
WriterEvents, WriterPosition
All Known Implementing Classes:
EmptyListShim, SimpleListShim, UnionShim.AbstractUnionShim, UnionVectorShim

public interface UnionShim extends WriterEvents
Unions are overly complex. They can evolve from no type, to a single type, to multiple types. The kind of vector used in these cases differ. This shim acts as a facade between the writer and the underlying vector, allowing the writer to remain constant while the vector (and its shim) evolves.
  • Method Details

    • bindWriter

      void bindWriter(UnionWriterImpl writer)
    • setNull

      void setNull()
    • hasType

      boolean hasType(TypeProtos.MinorType type)
    • member

      Return an existing writer for the given type, or create a new one if needed.
      Parameters:
      type - desired variant type
      Returns:
      a writer for that type
    • setType

      void setType(TypeProtos.MinorType type)
    • lastWriteIndex

      int lastWriteIndex()
      Description copied from interface: WriterPosition
      Return the last write position in the vector. This may be the same as the writer index position (if the vector was written at that point), or an earlier point. In either case, this value points to the last valid value in the vector.
      Specified by:
      lastWriteIndex in interface WriterPosition
      Returns:
      index of the last valid value in the vector
    • rowStartIndex

      int rowStartIndex()
      Description copied from interface: WriterPosition
      Position within the vector of the first value for the current row. Note that this is always the first value for the row, even for a writer deeply nested within a hierarchy of arrays. (The first position for the current array is not exposed in this API.)
      Specified by:
      rowStartIndex in interface WriterPosition
      Returns:
      the vector offset of the first value for the current row
    • addMember

      AbstractObjectWriter addMember(ColumnMetadata colSchema)
    • addMember

    • addMember

      void addMember(AbstractObjectWriter colWriter)
    • isProjected

      boolean isProjected()