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
-
Field Summary
Modifier and TypeFieldDescriptionprotected NullStateReader
protected final AbstractObjectReader[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionarray
(int colIndex) void
void
bindIndex
(ColumnReaderIndex index) void
bindNullState
(NullStateReader nullStateReader) column
(int colIndex) Return a column reader by column index as reported by the associated metadata.Return a column reader by name.int
dict
(int colIndex) Return the entire object as a string.Return the value of the underlying data as a Java object.boolean
isNull()
Determine if this value is null.void
scalar
(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, wait
Methods inherited from interface org.apache.drill.exec.vector.accessor.ColumnReader
schema
Methods 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:ColumnReader
The type of this reader.- Specified by:
type
in interfaceColumnReader
- Returns:
- type of reader
-
bindIndex
- Specified by:
bindIndex
in interfaceReaderEvents
-
bindNullState
- Specified by:
bindNullState
in interfaceReaderEvents
-
bindBuffer
public void bindBuffer()- Specified by:
bindBuffer
in interfaceReaderEvents
-
nullStateReader
- Specified by:
nullStateReader
in interfaceReaderEvents
-
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 interfaceColumnReader
- Returns:
- true if this value is null; false otherwise
-
columnCount
public int columnCount()- Specified by:
columnCount
in interfaceTupleReader
-
column
Description copied from interface:TupleReader
Return a column reader by column index as reported by the associated metadata.- Specified by:
column
in interfaceTupleReader
- Parameters:
colIndex
- column index- Returns:
- reader for the column
-
column
Description copied from interface:TupleReader
Return a column reader by name.- Specified by:
column
in interfaceTupleReader
- Parameters:
colName
- column name- Returns:
- reader for the column, or null if no such column exists
-
type
- Specified by:
type
in interfaceTupleReader
-
type
- Specified by:
type
in interfaceTupleReader
-
scalar
- Specified by:
scalar
in interfaceTupleReader
-
scalar
- Specified by:
scalar
in interfaceTupleReader
-
tuple
- Specified by:
tuple
in interfaceTupleReader
-
tuple
- Specified by:
tuple
in interfaceTupleReader
-
array
- Specified by:
array
in interfaceTupleReader
-
array
- Specified by:
array
in interfaceTupleReader
-
variant
- Specified by:
variant
in interfaceTupleReader
-
variant
- Specified by:
variant
in interfaceTupleReader
-
dict
- Specified by:
dict
in interfaceTupleReader
-
dict
- Specified by:
dict
in interfaceTupleReader
-
reposition
public void reposition()- Specified by:
reposition
in interfaceReaderEvents
-
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 interfaceColumnReader
- Returns:
- the value as a Java object
-
getAsString
Description copied from interface:ColumnReader
Return the entire object as a string. Primarily for debugging.- Specified by:
getAsString
in interfaceColumnReader
- Returns:
- string representation of the object
-