Class ScanSchemaOrchestrator.ScanOrchestratorBuilder

java.lang.Object
org.apache.drill.exec.physical.impl.scan.project.ScanSchemaOrchestrator.ScanOrchestratorBuilder
Direct Known Subclasses:
ManagedScanFramework.ScanFrameworkBuilder
Enclosing class:
ScanSchemaOrchestrator

public abstract static class ScanSchemaOrchestrator.ScanOrchestratorBuilder extends Object
  • Field Details

    • disableEmptyResults

      public boolean disableEmptyResults
      Option to disable empty results. An empty result occurs if no reader has any data, but at least one reader can provide a schema. In this case, the scan can return a single, empty batch, with an associated schema. This is the correct SQL result for an empty query. However, if this result triggers empty-batch bugs in other operators, we can, instead, disable this feature and return a null result set: no schema, no batch, just a "fast NONE", an immediate return of NONE from the Volcano iterator.

      Disabling this option is not desirable: it means that the user gets no schema for queries that should be able to return one. So, disable this option only if we cannot find or fix empty-batch bugs.

  • Constructor Details

    • ScanOrchestratorBuilder

      public ScanOrchestratorBuilder()
  • Method Details

    • withImplicitColumns

      public void withImplicitColumns(MetadataManager metadataMgr)
      Specify an optional metadata manager. Metadata is a set of constant columns with per-reader values. For file-based sources, this is usually the implicit and partition columns; but it could be other items for other data sources.
      Parameters:
      metadataMgr - the application-specific metadata manager to use for this scan
    • batchRecordLimit

      public void batchRecordLimit(int batchRecordLimit)
      Specify a custom batch record count. This is the maximum number of records per batch for this scan. Readers can adjust this, but the adjustment is capped at the value specified here
      Parameters:
      batchRecordLimit - maximum records per batch
    • batchByteLimit

      public void batchByteLimit(int byteLimit)
    • nullType

      public void nullType(TypeProtos.MajorType nullType)
      Specify the type to use for null columns in place of the standard nullable int. This type is used for all missing columns. (Readers that need per-column control need a different mechanism.)
      Parameters:
      nullType - the type to use for null columns
    • enableSchemaSmoothing

      public void enableSchemaSmoothing(boolean flag)
      Enable schema smoothing: introduces an addition level of schema resolution each time a schema changes from a reader.
      Parameters:
      flag - true to enable schema smoothing, false to disable
    • allowRequiredNullColumns

      public void allowRequiredNullColumns(boolean flag)
    • addParser

      public void addParser(ScanLevelProjection.ScanProjectionParser parser)
    • addResolver

      public void addResolver(ReaderLevelProjection.ReaderProjectionResolver resolver)
    • projection

      public void projection(List<SchemaPath> projection)
    • enableSchemaBatch

      public void enableSchemaBatch(boolean option)
    • disableEmptyResults

      public void disableEmptyResults(boolean option)
    • providedSchema

      public void providedSchema(TupleMetadata providedSchema)
    • providedSchema

      public TupleMetadata providedSchema()
    • limit

      public void limit(long limit)
    • limit

      public long limit()
    • errorContext

      public void errorContext(CustomErrorContext context)
    • errorContext

      public CustomErrorContext errorContext()
    • buildScan

      public ScanOperatorExec buildScan()
    • buildScanOperator

      public OperatorRecordBatch buildScanOperator(FragmentContext fragContext, PhysicalOperator pop)
    • buildEvents

      public abstract ScanOperatorEvents buildEvents()