Interface OutputMutator

All Known Implementing Classes:
ScanBatch.Mutator

public interface OutputMutator
Interface that allows a record reader to modify the current schema. The output mutator interface abstracts ValueVector creation and maintenance away from any particular RecordReader. This means, among other things, that a new RecordReader that shares the same column definitions in a different order does not generate a Schema change event for downstream consumers.
  • Method Details

    • addField

      <T extends ValueVector> T addField(MaterializedField field, Class<T> clazz) throws SchemaChangeException
      Add a ValueVector for new (or existing) field.
      Parameters:
      field - The specification of the newly desired vector.
      clazz - The expected ValueVector class. Also allows strongly typed use of this interface.
      Returns:
      The existing or new ValueVector associated with the provided field.
      Throws:
      SchemaChangeException - If the addition of this field is incompatible with this OutputMutator's capabilities.
    • allocate

      void allocate(int recordCount)
    • isNewSchema

      boolean isNewSchema()
      Whether or not the fields added to the OutputMutator generated a new schema event.
      Returns:
    • getManagedBuffer

      DrillBuf getManagedBuffer()
      Allows a scanner to request a set of managed block of memory.
      Returns:
      A DrillBuf that will be released at the end of the current query (and can be resized as desired during use).
    • getCallBack

      CallBack getCallBack()
      Returns:
      the CallBack object for this mutator
    • clear

      void clear()
      Clear this mutator i.e. reset it to pristine condition