Class RepeatedVarCharOutput

java.lang.Object
org.apache.drill.exec.store.easy.text.reader.BaseFieldOutput
org.apache.drill.exec.store.easy.text.reader.RepeatedVarCharOutput

public class RepeatedVarCharOutput extends BaseFieldOutput
Class is responsible for generating record batches for text file inputs. We generate a record batch with a single vector of type repeated varchar vector. Each record is a single value within the vector containing all the fields in the record as individual array elements.
  • Constructor Details

    • RepeatedVarCharOutput

      public RepeatedVarCharOutput(RowSetLoader loader, boolean[] projectionMask)
      Provide the row set loader (which must have just one repeated Varchar column) and an optional array projection mask.
      Parameters:
      loader - row set loader
      projectionMask - array projection mask
  • Method Details

    • endField

      public boolean endField()
      Write the value into an array position. Rules:
      • If there is no projection mask, collect all columns.
      • If a selection mask is present, we previously found the index of the last projection column (maxField). If the current column is beyond that number, ignore the data and stop accepting columns.
      • If the column is projected, add the data to the array.
      • If the column is not projected, add a blank value to the array.
      The above ensures that we leave no holes in the portion of the array that is projected (by adding blank columns where needed), and we just ignore columns past the end of the projected part of the array. (No need to fill holes at the end.)
      Overrides:
      endField in class BaseFieldOutput
    • columnWriter

      protected ScalarWriter columnWriter()
      Specified by:
      columnWriter in class BaseFieldOutput