Class BaseFieldOutput

Direct Known Subclasses:
ConstrainedFieldOutput, RepeatedVarCharOutput

public abstract class BaseFieldOutput extends Object
  • Field Details

    • currentFieldIndex

      protected int currentFieldIndex
    • currentDataPointer

      protected int currentDataPointer
    • fieldWriteCount

      protected int fieldWriteCount
    • fieldBytes

      protected byte[] fieldBytes
    • writer

      protected final RowSetLoader writer
    • maxField

      protected final int maxField
    • fieldProjected

      protected boolean fieldProjected
  • Constructor Details

    • BaseFieldOutput

      public BaseFieldOutput(RowSetLoader writer, int maxField, boolean[] projectionMask)
      Initialize the field output for one of three scenarios:
      • SELECT all: SELECT *, SELECT columns. Indicated by a non -1 max fields.
      • SELECT none: SELECT COUNT(*), etc. Indicated by a max field of -1.
      • SELECT a, b, c indicated by a non-null projection mask that identifies the indexes of the fields to be selected. In this case, this constructor computes the maximum field.
      writer - Row set writer that provides access to the writer for each column
      maxField - the index of the last field to store. May be -1 if no fields are to be stored. Computed if the projection mask is set
      projectionMask - a boolean array indicating which fields are to be projected to the output. Optional
  • Method Details

    • startRecord

      public void startRecord()
      Start a new record record. Resets all pointers
    • startField

      public void startField(int index)
    • append

      public void append(byte data)
    • writeToVector

      protected void writeToVector()
      Write a buffer of data to the underlying vector using the column writer. The buffer holds a complete or partial chunk of data for the field. If this is the first data for the field, write the bytes. If this is a second buffer for the same field, append the bytes. The append will work if the underlying vector is VarChar, it will fail if a type conversion shim is in between. (This is generally OK because the previous setBytes should have failed because a large int or date is not supported.)
    • columnWriter

      protected abstract ValueWriter columnWriter()
    • endField

      public boolean endField()
    • endEmptyField

      public boolean endEmptyField()
    • finishRecord

      public void finishRecord()
    • getRecordCount

      public long getRecordCount()
    • isFull

      public boolean isFull()