Class ScanBatch.Mutator

java.lang.Object
org.apache.drill.exec.physical.impl.ScanBatch.Mutator
All Implemented Interfaces:
OutputMutator
Enclosing class:
ScanBatch

public static class ScanBatch.Mutator extends Object implements OutputMutator
Row set mutator implementation provided to record readers created by this scan batch. Made visible so that tests can create this mutator without also needing a ScanBatch instance. (This class is really independent of the ScanBatch, but resides here for historical reasons. This is, in turn, the only use of the generated vector readers in the vector package.)
  • Constructor Details

  • Method Details

    • fieldVectorMap

      public Map<String,ValueVector> fieldVectorMap()
    • implicitFieldVectorMap

      public Map<String,ValueVector> implicitFieldVectorMap()
    • addField

      public <T extends ValueVector> T addField(MaterializedField field, Class<T> clazz) throws SchemaChangeException
      Description copied from interface: OutputMutator
      Add a ValueVector for new (or existing) field.
      Specified by:
      addField in interface OutputMutator
      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

      public void allocate(int recordCount)
      Specified by:
      allocate in interface OutputMutator
    • isNewSchema

      public boolean isNewSchema()
      Reports whether schema has changed (field was added or re-added) since last call to isNewSchema(). Returns true at first call.
      Specified by:
      isNewSchema in interface OutputMutator
      Returns:
    • getManagedBuffer

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

      public CallBack getCallBack()
      Specified by:
      getCallBack in interface OutputMutator
      Returns:
      the CallBack object for this mutator
    • clear

      public void clear()
      Description copied from interface: OutputMutator
      Clear this mutator i.e. reset it to pristine condition
      Specified by:
      clear in interface OutputMutator