public class FileScanLifecycle extends ScanLifecycle
FileSchemaNegotiator
passes
file information to each reader.
Only a single storage plugin uses the file scan framework:
the FileSystemPlugin
via the EasyFormatPlugin
. To
make client code as simple as possible, the Drill file system and list
of files is passed though this framework to the
FileReaderFactory
, then to the FileSchemaNegotiator
which presents them to the reader. This approach avoids the need
for each format handle this common boilerplate code.
The FileScanOptions
holds the list of splits to scan. The
FileReaderFactory
iterates over those splits, and
creates each reader just-in-time to process that split.
Implicit columns are defined here at the beginning of the scan as
part of the scan schema mechanism. Each consists of a column "marker"
that identifies the column purposes. Then, on each file, the implicit
column is resolved to a value specific to that file. A
StaticBatchBuilder
then fills in the needed column values
for each batch which the reader produces.
Constructor and Description |
---|
FileScanLifecycle(OperatorContext context,
FileScanLifecycleBuilder options) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
FileScanLifecycleBuilder |
fileScanOptions() |
DrillFileSystem |
fileSystem() |
ImplicitFileColumnsHandler |
implicitColumnsHandler() |
protected SchemaNegotiatorImpl |
newNegotiator(ReaderLifecycle readerLifecycle) |
allocator, batchCount, context, errorContext, hasOutputSchema, nextReader, options, outputSchema, readerFactory, rowCount, schemaTracker, tallyBatch, vectorCache
public FileScanLifecycle(OperatorContext context, FileScanLifecycleBuilder options)
public FileScanLifecycleBuilder fileScanOptions()
public DrillFileSystem fileSystem()
public ImplicitFileColumnsHandler implicitColumnsHandler()
protected SchemaNegotiatorImpl newNegotiator(ReaderLifecycle readerLifecycle)
newNegotiator
in class ScanLifecycle
public void close()
close
in class ScanLifecycle
Copyright © 1970 The Apache Software Foundation. All rights reserved.