public interface RecordBatch extends VectorAccessible
In the case of a record batch composed of ValueVectors, ideally a batch
fits within L2 cache (~256kB per core). The set of value vectors does
not change except during a call to next() that returns
RecordBatch.IterOutcome.OK_NEW_SCHEMA value.
A key thing to know is that the Iterator provided by a record batch must
align with the rank positions of the field IDs provided using
getValueVectorId(org.apache.drill.common.expression.SchemaPath).
| Modifier and Type | Interface and Description |
|---|---|
static class |
RecordBatch.IterOutcome
Describes the outcome of incrementing RecordBatch forward by a call to
next(). |
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_BATCH_ROW_COUNT
max num of rows in a batch, limited by 2-byte length in SV2: 65536 = 2^16
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Informs child operators that no more data is needed.
|
void |
dump()
Perform dump of this batch's state to logs.
|
VectorContainer |
getContainer()
Return the internal vector container
|
FragmentContext |
getContext()
Gets the FragmentContext of the current query fragment.
|
VectorContainer |
getOutgoingContainer() |
BatchSchema |
getSchema()
Gets the current schema of this record batch.
|
VectorWrapper<?> |
getValueAccessorById(Class<?> clazz,
int... ids) |
TypedFieldId |
getValueVectorId(SchemaPath path)
Gets the value vector type and ID for the given schema path.
|
WritableBatch |
getWritableBatch()
Gets a writable version of this batch.
|
RecordBatch.IterOutcome |
next()
Updates the data in each Field reading interface for the next range of
records.
|
getRecordCount, getSelectionVector2, getSelectionVector4forEach, iterator, spliteratorstatic final int MAX_BATCH_ROW_COUNT
FragmentContext getContext()
BatchSchema getSchema()
May be called only when the most recent call to next(), if any,
returned RecordBatch.IterOutcome.OK_NEW_SCHEMA or RecordBatch.IterOutcome.OK.
The schema changes when and only when next() returns
RecordBatch.IterOutcome.OK_NEW_SCHEMA.
getSchema in interface VectorAccessiblevoid cancel()
The operator which triggers the cancel MUST send a NONE
status downstream, or throw an exception. It is not legal to
call next() on an operator after calling its
cancel() method.
VectorContainer getOutgoingContainer()
VectorContainer getContainer()
TypedFieldId getValueVectorId(SchemaPath path)
Iterable<ValueVector>.getValueVectorId in interface VectorAccessiblepath - The path where the vector should be located.VectorWrapper<?> getValueAccessorById(Class<?> clazz, int... ids)
getValueAccessorById in interface VectorAccessibleRecordBatch.IterOutcome next()
Once a RecordBatch's next() has returned RecordBatch.IterOutcome.NONE
or IterOutcome#STOP, the consumer should no longer call
next(). Behavior at this point is undefined and likely to
throw an exception.
See RecordBatch.IterOutcome for the protocol (possible sequences of return
values).
WritableBatch getWritableBatch()
void dump()
Copyright © 2021 The Apache Software Foundation. All rights reserved.