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_SIZE
max batch size, limited by 2-byte length in SV2: 65536 = 2^16
|
| Modifier and Type | Method and Description |
|---|---|
FragmentContext |
getContext()
Gets the FragmentContext of the current query fragment.
|
VectorContainer |
getOutgoingContainer() |
int |
getRecordCount()
Gets the number of records that are within this record.
|
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.
|
void |
kill(boolean sendUpstream)
Informs child nodes that this query should be terminated.
|
RecordBatch.IterOutcome |
next()
Updates the data in each Field reading interface for the next range of
records.
|
getSelectionVector2, getSelectionVector4static final int MAX_BATCH_SIZE
FragmentContext getContext()
BatchSchema getSchema()
May be called only when the most recent call to next(), if any,
returned #OK_NEW_SCHEMA or #OK.
The schema changes when and only when next() returns
#OK_NEW_SCHEMA.
getSchema in interface VectorAccessibleint getRecordCount()
getRecordCount in interface VectorAccessiblevoid kill(boolean sendUpstream)
VectorContainer getOutgoingContainer()
TypedFieldId getValueVectorId(SchemaPath path)
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 RecordBatch.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()
Copyright © 2017 The Apache Software Foundation. All rights reserved.