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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatch(VectorContainer container) Define an output batch.intgetValueAccessorById(Class<?> clazz, int... ids) getValueVectorId(SchemaPath path) iterator()voidrelease()introwCount()schema()intvoidsetSchema(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:
schemain interfaceBatchAccessor
-
schemaVersion
public int schemaVersion()- Specified by:
schemaVersionin interfaceBatchAccessor
-
rowCount
public int rowCount()- Specified by:
rowCountin interfaceBatchAccessor
-
container
- Specified by:
containerin interfaceBatchAccessor
-
getValueVectorId
- Specified by:
getValueVectorIdin interfaceBatchAccessor
-
getValueAccessorById
- Specified by:
getValueAccessorByIdin interfaceBatchAccessor
-
writableBatch
- Specified by:
writableBatchin interfaceBatchAccessor
-
selectionVector2
- Specified by:
selectionVector2in interfaceBatchAccessor
-
selectionVector4
- Specified by:
selectionVector4in interfaceBatchAccessor
-
iterator
- Specified by:
iteratorin interfaceBatchAccessor
-
release
public void release()- Specified by:
releasein interfaceBatchAccessor
-