Class ReaderIndex
java.lang.Object
org.apache.drill.exec.physical.resultSet.model.ReaderIndex
- All Implemented Interfaces:
ColumnReaderIndex
- Direct Known Subclasses:
DirectRowIndex
,HyperRowIndex
,IndirectRowIndex
Row set index base class used when indexing rows within a row
set for a row set reader. Keeps track of the current position,
which starts before the first row, meaning that the client
must call next() to advance to the first row.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasNext()
Reports if the index has another item.int
Ordinal index within the batch or array.boolean
next()
Advances the index to the next position.void
set
(int index) int
size()
Return the number of items that this index indexes: top-level record count for the root index; total element count for nested arrays.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.ColumnReaderIndex
hyperVectorIndex, offset
-
Field Details
-
position
protected int position -
rowCount
-
-
Constructor Details
-
ReaderIndex
-
-
Method Details
-
set
public void set(int index) -
logicalIndex
public int logicalIndex()Description copied from interface:ColumnReaderIndex
Ordinal index within the batch or array. Increments from -1. (The position before the first item.) Identifies the logical row number of top-level records, or the array element for arrays. Actual physical index may be different if an indirection layer is in use.- Specified by:
logicalIndex
in interfaceColumnReaderIndex
- Returns:
- logical read index
-
size
public int size()Description copied from interface:ColumnReaderIndex
Return the number of items that this index indexes: top-level record count for the root index; total element count for nested arrays.- Specified by:
size
in interfaceColumnReaderIndex
- Returns:
- element count at this index level
-
next
public boolean next()Description copied from interface:ColumnReaderIndex
Advances the index to the next position. Used:- At the top level for normal readers or <liAt a nested level for implicit join readers, and
- An each array level to iterate over arrays.
- Specified by:
next
in interfaceColumnReaderIndex
- Returns:
- true if another value is available, false if EOF
-
hasNext
public boolean hasNext()Description copied from interface:ColumnReaderIndex
Reports if the index has another item.- Specified by:
hasNext
in interfaceColumnReaderIndex
- Returns:
if more rows remain. That is, if a call to ColumnReaderIndex.next()
would return true.
-