Class AbstractTupleReader

java.lang.Object
org.apache.drill.exec.vector.accessor.reader.AbstractTupleReader
All Implemented Interfaces:
ColumnReader, ReaderEvents, TupleReader
Direct Known Subclasses:
DictEntryReader, MapReader, RowSetReaderImpl

public abstract class AbstractTupleReader extends Object implements TupleReader, ReaderEvents
Reader for a tuple (a row or a map.) Provides access to each column using either a name or a numeric index.
  • Field Details

  • Constructor Details

  • Method Details

    • type

      public ObjectType type()
      Description copied from interface: ColumnReader
      The type of this reader.
      Specified by:
      type in interface ColumnReader
      Returns:
      type of reader
    • bindIndex

      public void bindIndex(ColumnReaderIndex index)
      Specified by:
      bindIndex in interface ReaderEvents
    • bindNullState

      public void bindNullState(NullStateReader nullStateReader)
      Specified by:
      bindNullState in interface ReaderEvents
    • bindBuffer

      public void bindBuffer()
      Specified by:
      bindBuffer in interface ReaderEvents
    • nullStateReader

      public NullStateReader nullStateReader()
      Specified by:
      nullStateReader in interface ReaderEvents
    • isNull

      public boolean isNull()
      Description copied from interface: ColumnReader
      Determine if this value is null.
      • Nullable scalar: determine if the value is null.
      • Non-nullable scalar: always returns false.
      • Arrays: always returns false</tt.>
      • Lists: determine if the list for the current row is null. In a list, an array entry can be null, empty, or can contain items. In repeated types, the array itself is never null. If the array is null, then it implicitly has no entries.
      • Map or Repeated Map: Always returns false.
      • Map inside a union, or in a list that contains a union, the tuple itself can be null.
      • Union: Determine if the current value is null. Null values have no type and no associated reader.
      Specified by:
      isNull in interface ColumnReader
      Returns:
      true if this value is null; false otherwise
    • columnCount

      public int columnCount()
      Specified by:
      columnCount in interface TupleReader
    • column

      public ObjectReader column(int colIndex)
      Description copied from interface: TupleReader
      Return a column reader by column index as reported by the associated metadata.
      Specified by:
      column in interface TupleReader
      Parameters:
      colIndex - column index
      Returns:
      reader for the column
    • column

      public ObjectReader column(String colName)
      Description copied from interface: TupleReader
      Return a column reader by name.
      Specified by:
      column in interface TupleReader
      Parameters:
      colName - column name
      Returns:
      reader for the column, or null if no such column exists
    • type

      public ObjectType type(int colIndex)
      Specified by:
      type in interface TupleReader
    • type

      public ObjectType type(String colName)
      Specified by:
      type in interface TupleReader
    • scalar

      public ScalarReader scalar(int colIndex)
      Specified by:
      scalar in interface TupleReader
    • scalar

      public ScalarReader scalar(String colName)
      Specified by:
      scalar in interface TupleReader
    • tuple

      public TupleReader tuple(int colIndex)
      Specified by:
      tuple in interface TupleReader
    • tuple

      public TupleReader tuple(String colName)
      Specified by:
      tuple in interface TupleReader
    • array

      public ArrayReader array(int colIndex)
      Specified by:
      array in interface TupleReader
    • array

      public ArrayReader array(String colName)
      Specified by:
      array in interface TupleReader
    • variant

      public VariantReader variant(int colIndex)
      Specified by:
      variant in interface TupleReader
    • variant

      public VariantReader variant(String colName)
      Specified by:
      variant in interface TupleReader
    • dict

      public DictReader dict(int colIndex)
      Specified by:
      dict in interface TupleReader
    • dict

      public DictReader dict(String colName)
      Specified by:
      dict in interface TupleReader
    • reposition

      public void reposition()
      Specified by:
      reposition in interface ReaderEvents
    • getObject

      public Object getObject()
      Description copied from interface: ColumnReader
      Return the value of the underlying data as a Java object. Primarily for testing
      • Array: Return the entire array as an List of objects. Note, even if the array is scalar, the elements are still returned as a list.
      Specified by:
      getObject in interface ColumnReader
      Returns:
      the value as a Java object
    • getAsString

      public String getAsString()
      Description copied from interface: ColumnReader
      Return the entire object as a string. Primarily for debugging.
      Specified by:
      getAsString in interface ColumnReader
      Returns:
      string representation of the object