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
Reader for a tuple (a row or a map.) Provides access to each
column using either a name or a numeric index.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NullStateReaderprotected final AbstractObjectReader[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarray(int colIndex) voidvoidbindIndex(ColumnReaderIndex index) voidbindNullState(NullStateReader nullStateReader) column(int colIndex) Return a column reader by column index as reported by the associated metadata.Return a column reader by name.intdict(int colIndex) Return the entire object as a string.Return the value of the underlying data as a Java object.booleanisNull()Determine if this value is null.voidscalar(int colIndex) tuple(int colIndex) type()The type of this reader.type(int colIndex) variant(int colIndex) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.drill.exec.vector.accessor.ColumnReader
schemaMethods inherited from interface org.apache.drill.exec.vector.accessor.TupleReader
tupleSchema
-
Field Details
-
readers
-
nullStateReader
-
-
Constructor Details
-
AbstractTupleReader
-
-
Method Details
-
type
Description copied from interface:ColumnReaderThe type of this reader.- Specified by:
typein interfaceColumnReader- Returns:
- type of reader
-
bindIndex
- Specified by:
bindIndexin interfaceReaderEvents
-
bindNullState
- Specified by:
bindNullStatein interfaceReaderEvents
-
bindBuffer
public void bindBuffer()- Specified by:
bindBufferin interfaceReaderEvents
-
nullStateReader
- Specified by:
nullStateReaderin interfaceReaderEvents
-
isNull
public boolean isNull()Description copied from interface:ColumnReaderDetermine if this value is null.- Nullable scalar: determine if the value is null.
- Non-nullable scalar: always returns false.
- Arrays: always returns falseinvalid input: '<'/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:
isNullin interfaceColumnReader- Returns:
- true if this value is null; false otherwise
-
columnCount
public int columnCount()- Specified by:
columnCountin interfaceTupleReader
-
column
Description copied from interface:TupleReaderReturn a column reader by column index as reported by the associated metadata.- Specified by:
columnin interfaceTupleReader- Parameters:
colIndex- column index- Returns:
- reader for the column
-
column
Description copied from interface:TupleReaderReturn a column reader by name.- Specified by:
columnin interfaceTupleReader- Parameters:
colName- column name- Returns:
- reader for the column, or null if no such column exists
-
type
- Specified by:
typein interfaceTupleReader
-
type
- Specified by:
typein interfaceTupleReader
-
scalar
- Specified by:
scalarin interfaceTupleReader
-
scalar
- Specified by:
scalarin interfaceTupleReader
-
tuple
- Specified by:
tuplein interfaceTupleReader
-
tuple
- Specified by:
tuplein interfaceTupleReader
-
array
- Specified by:
arrayin interfaceTupleReader
-
array
- Specified by:
arrayin interfaceTupleReader
-
variant
- Specified by:
variantin interfaceTupleReader
-
variant
- Specified by:
variantin interfaceTupleReader
-
dict
- Specified by:
dictin interfaceTupleReader
-
dict
- Specified by:
dictin interfaceTupleReader
-
reposition
public void reposition()- Specified by:
repositionin interfaceReaderEvents
-
getObject
Description copied from interface:ColumnReaderReturn 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:
getObjectin interfaceColumnReader- Returns:
- the value as a Java object
-
getAsString
Description copied from interface:ColumnReaderReturn the entire object as a string. Primarily for debugging.- Specified by:
getAsStringin interfaceColumnReader- Returns:
- string representation of the object
-