Class ResultSetOptionBuilder

java.lang.Object
org.apache.drill.exec.physical.resultSet.impl.ResultSetOptionBuilder

public class ResultSetOptionBuilder extends Object
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 Details

    • vectorSizeLimit

      protected int vectorSizeLimit
    • rowCountLimit

      protected int rowCountLimit
    • vectorCache

      protected ResultVectorCache vectorCache
    • projectionSet

      protected RequestedTuple projectionSet
    • projectionFilter

      protected ProjectionFilter projectionFilter
    • readerSchema

      protected TupleMetadata readerSchema
    • maxBatchSize

      protected long maxBatchSize
    • scanLimit

      protected long scanLimit
    • errorContext

      protected CustomErrorContext errorContext
      Error message context
  • Constructor Details

    • ResultSetOptionBuilder

      public ResultSetOptionBuilder()
  • Method Details

    • rowCountLimit

      public ResultSetOptionBuilder rowCountLimit(int limit)
      Specify the maximum number of rows per batch. Defaults to BaseValueVector.INITIAL_VALUE_ALLOCATION. Batches end either when this limit is reached, or when a vector overflows, whichever occurs first. The limit is capped at ValueVector.MAX_ROW_COUNT.
      Parameters:
      limit - the row count limit
      Returns:
      this builder
    • batchSizeLimit

      public ResultSetOptionBuilder batchSizeLimit(int bytes)
    • vectorCache

      public ResultSetOptionBuilder vectorCache(ResultVectorCache 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

      public ResultSetOptionBuilder 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. 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

      public ResultSetOptionBuilder projection(RequestedTuple projSet)
    • projectionFilter

      public ResultSetOptionBuilder projectionFilter(ProjectionFilter projectionFilter)
    • limit

      public ResultSetOptionBuilder limit(long limit)
    • errorContext

      public ResultSetOptionBuilder errorContext(CustomErrorContext context)
      Provides context for error messages.
    • build