Interface ArrayReader
- All Superinterfaces:
ColumnReader
- All Known Subinterfaces:
DictReader
- All Known Implementing Classes:
ArrayReaderImpl
,DictReaderImpl
Generic array reader. An array is one of the following:
- Array of scalars. Read the values using
#elements()
, which provides an array-like access to the scalars. - A repeated map. Use
#tuple(int)
to get a tuple reader for a specific array element. Usesize()
to learn the number of maps in the array. - List of lists. Use the
#array(int)
method to get the nested list at a given index. Usesize()
to learn the number of maps in the array.
-
Method Summary
Modifier and TypeMethodDescriptionarray()
entry()
Return the generic object reader for the array element.The object type of the list entry.boolean
next()
Move forward one position.void
rewind()
scalar()
void
setPosn
(int index) Set the array reader to read a given array entry.int
size()
Number of elements in the array.tuple()
variant()
Methods inherited from interface org.apache.drill.exec.vector.accessor.ColumnReader
getAsString, getObject, isNull, schema, type
-
Method Details
-
size
int size()Number of elements in the array.- Returns:
- the number of elements
-
entryType
ObjectType entryType()The object type of the list entry. All entries have the same type.- Returns:
- the object type of each entry
-
entry
ObjectReader entry()Return the generic object reader for the array element. This version does not position the reader, the client must callsetPosn(int)
to set the position. This form allows up-front setup of the readers when convenient for the caller. -
scalar
ScalarReader scalar() -
tuple
TupleReader tuple() -
array
ArrayReader array() -
variant
VariantReader variant() -
setPosn
void setPosn(int index) -
rewind
void rewind() -
next
boolean next()Move forward one position.- Returns:
- true if another position is available, false if the end of the array is reached
-