Class ResultSetOptionBuilder
java.lang.Object
org.apache.drill.exec.physical.resultSet.impl.ResultSetOptionBuilder
Builder for the options for the row set loader. Reasonable defaults
are provided for all options; use the default options for test code or
for clients that don't need special settings.
-
Field Summary
Modifier and TypeFieldDescriptionprotected CustomErrorContext
Error message contextprotected long
protected ProjectionFilter
protected RequestedTuple
protected TupleMetadata
protected int
protected long
protected ResultVectorCache
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbatchSizeLimit
(int bytes) build()
errorContext
(CustomErrorContext context) Provides context for error messages.limit
(long limit) projection
(RequestedTuple projSet) projectionFilter
(ProjectionFilter projectionFilter) readerSchema
(TupleMetadata readerSchema) Clients can use the row set builder in several ways: Provide the schema up front, when known, by using this method to provide the schema. Discover the schema on the fly, adding columns during the write operation.rowCountLimit
(int limit) Specify the maximum number of rows per batch.vectorCache
(ResultVectorCache vectorCache) Downstream operators require "vector persistence": the same vector must represent the same column in every batch.
-
Field Details
-
vectorSizeLimit
protected int vectorSizeLimit -
rowCountLimit
protected int rowCountLimit -
vectorCache
-
projectionSet
-
projectionFilter
-
readerSchema
-
maxBatchSize
protected long maxBatchSize -
scanLimit
protected long scanLimit -
errorContext
Error message context
-
-
Constructor Details
-
ResultSetOptionBuilder
public ResultSetOptionBuilder()
-
-
Method Details
-
rowCountLimit
Specify the maximum number of rows per batch. Defaults toBaseValueVector.INITIAL_VALUE_ALLOCATION
. Batches end either when this limit is reached, or when a vector overflows, whichever occurs first. The limit is capped atValueVector.MAX_ROW_COUNT
.- Parameters:
limit
- the row count limit- Returns:
- this builder
-
batchSizeLimit
-
vectorCache
Downstream operators require "vector persistence": the same vector must represent the same column in every batch. For the scan operator, which creates multiple readers, this can be a challenge. The vector cache provides a transparent mechanism to enable vector persistence by returning the same vector for a set of independent readers. By default, the code uses a "null" cache which creates a new vector on each request. If a true cache is needed, the caller must provide one here. -
readerSchema
Clients can use the row set builder in several ways:- Provide the schema up front, when known, by using this method to provide the schema.
- Discover the schema on the fly, adding columns during the write operation. Leave this method unset to start with an empty schema.
- A combination of the above.
- Parameters:
readerSchema
- the initial schema for the loader- Returns:
- this builder
-
projection
-
projectionFilter
-
limit
-
errorContext
Provides context for error messages. -
build
-