Class VectorContainerAccessor
java.lang.Object
org.apache.drill.exec.physical.impl.protocol.VectorContainerAccessor
- All Implemented Interfaces:
BatchAccessor
- Direct Known Subclasses:
IndirectContainerAccessor
Wraps a vector container and optional selection vector in an interface
simpler than the entire
RecordBatch
. This implementation hosts
a container only.
Separates the idea of a batch schema and data batch. The accessor can identify a schema even if it has no batches. This occurs for readers that can identify the schema, but produce no actual data.
This version is designed for the the scan operator which will produce a series of different vector containers (which, oddly, must all contain the same vectors.)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBatch
(VectorContainer container) Define an output batch.int
getValueAccessorById
(Class<?> clazz, int... ids) getValueVectorId
(SchemaPath path) iterator()
void
release()
int
rowCount()
schema()
int
void
setSchema
(VectorContainer container) Define a schema that does not necessarily contain any data.
-
Field Details
-
container
-
-
Constructor Details
-
VectorContainerAccessor
public VectorContainerAccessor()
-
-
Method Details
-
setSchema
Define a schema that does not necessarily contain any data. Call this to declare a schema when there are no results to report. -
addBatch
Define an output batch. Called each time a new batch is sent downstream. Checks if the schema of this batch is the same as that of any previous batch, and updates the schema version if the schema changes. May be called with the same container as the previous call, or a different one. A schema change occurs unless the vectors are identical across the two containers.- Parameters:
container
- the container that holds vectors to be sent downstream
-
batchCount
public int batchCount() -
schema
- Specified by:
schema
in interfaceBatchAccessor
-
schemaVersion
public int schemaVersion()- Specified by:
schemaVersion
in interfaceBatchAccessor
-
rowCount
public int rowCount()- Specified by:
rowCount
in interfaceBatchAccessor
-
container
- Specified by:
container
in interfaceBatchAccessor
-
getValueVectorId
- Specified by:
getValueVectorId
in interfaceBatchAccessor
-
getValueAccessorById
- Specified by:
getValueAccessorById
in interfaceBatchAccessor
-
writableBatch
- Specified by:
writableBatch
in interfaceBatchAccessor
-
selectionVector2
- Specified by:
selectionVector2
in interfaceBatchAccessor
-
selectionVector4
- Specified by:
selectionVector4
in interfaceBatchAccessor
-
iterator
- Specified by:
iterator
in interfaceBatchAccessor
-
release
public void release()- Specified by:
release
in interfaceBatchAccessor
-