public interface ColumnReaderIndex
Further, when used with a logical join, the top-level iteration may be over an array, with an implicit join out to enclosing nesting levels.
Because of this, the same index interface must work at all nesting levels: at the top, and within arrays. This interface supports a usage model as follows:
ColumnReaderIndex index = ...
while (index.hasNext()) {
index.next();
int hyperIndex = index.hyperVectorIndex();
int vectorOffset = index.offset();
}
When convenient, the following abbreviated form is also supported:
ColumnReaderIndex index = ...
while (index.next()) {
int hyperIndex = index.hyperVectorIndex();
int vectorOffset = index.offset();
}
For a top-level index, the check of hasNext() and call to next() is done by the row set reader. For arrays, the call to hasNext() is done by the array reader. The call to next() is done by the scalar reader (for scalar arrays) or the array reader (for other arrays.)
The hyper-vector index has meaning only for top-level vectors,
and is ignored by nested vectors. (Nested vectors work by navigating
down from a top-level vector.) But, as noted above, any given
reader does not know if it is at the top or nested level, instead
it is the VectorAccessor
abstraction that works out the nesting levels.
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Reports if the index has another item.
|
int |
hyperVectorIndex()
When used with a hyper-vector (SV4) based batch, returns the
index of the current batch within the hyper-batch.
|
int |
logicalIndex()
Ordinal index within the batch or array.
|
boolean |
next()
Advances the index to the next position.
|
int |
offset()
Vector offset to read.
|
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.
|
int logicalIndex()
int hyperVectorIndex()
int offset()
boolean next()
boolean hasNext()
next()
would return true.int size()
Copyright © 1970 The Apache Software Foundation. All rights reserved.