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
, which provides an array-like access to the scalars.
invalid reference
#elements() - A repeated map. Use
to get a tuple reader for a specific array element. Use
invalid reference
#tuple(int)size()to learn the number of maps in the array. - List of lists. Use the
method to get the nested list at a given index. Use
invalid reference
#array(int)size()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.booleannext()Move forward one position.voidrewind()scalar()voidsetPosn(int index) Set the array reader to read a given array entry.intsize()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
-