public class SchemaBasedTracker extends AbstractSchemaTracker
ScanSchemaTracker.ProjectionTypeerrorContext, isResolved, schema| Constructor and Description |
|---|
SchemaBasedTracker(TupleMetadata definedSchema,
CustomErrorContext errorContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyEarlyReaderSchema(TupleMetadata readerSchema)
If a reader can define a schema before reading data, apply that
schema to the scan schema.
|
void |
applyReaderSchema(TupleMetadata readerOutputSchema,
CustomErrorContext errorContext)
Once a reader has read a batch, the reader will have provided a type
for each projected column which the reader knows about.
|
ProjectedColumn |
columnProjection(String colName)
Return the projection for a column, if any.
|
void |
expandImplicitCol(ColumnMetadata resolved,
ImplicitColumnMarker marker)
Drill defines a wildcard to expand not just reader columns, but also
partition columns.
|
ProjectionFilter |
projectionFilter(CustomErrorContext errorContext)
Set up a projection filter using the defined schema
|
int |
schemaVersion()
Gives the output schema version which will start at some arbitrary
positive number.
|
void |
validateProjection(TupleMetadata projection)
Validate a projection list (provided as an argument) against a
defined schema already held by this tracker.
|
applyImplicitCols, checkResolved, errorContext, internalSchema, isResolved, missingColumns, outputSchema, projectionType, readerInputSchema, resolveMissingCols, validateProjectionpublic SchemaBasedTracker(TupleMetadata definedSchema, CustomErrorContext errorContext)
public void validateProjection(TupleMetadata projection)
projection - the parsed projection listpublic void applyEarlyReaderSchema(TupleMetadata readerSchema)
ScanSchemaTrackerpublic ProjectionFilter projectionFilter(CustomErrorContext errorContext)
errorContext - the reader-specific error context to use if
errors are foundpublic void applyReaderSchema(TupleMetadata readerOutputSchema, CustomErrorContext errorContext)
ScanSchemaTracker
The process can raise an exception if the reader projects a column that
it shouldn't (which is not actually possible because of the way the
ResultSetLoader works.) An error can also occur if the reader
provides a type different than that already defined in the scan schema
by a defined schema, a provided schema, or a previous reader in the same
scan. In such cases, the reader is expected to have converted its input
type to the specified type, which was presumably selected because the
reader is capable of the required conversion.
readerOutputSchema - the actual schema produced by a reader when
reading a record batcherrorContext - the reader-specific error context to use if
errors are foundpublic void expandImplicitCol(ColumnMetadata resolved, ImplicitColumnMarker marker)
ScanSchemaTracker#isProjectAll()), the handler
then determines which partition columns are needed and calls this
method to add each one.public int schemaVersion()
ScanSchemaTrackerIf schema change is allowed, the schema version allows detecting schema changes as the scan schema moves from one resolved state to the next. Each schema will have a unique, increasing version number. A schema change has occurred if the version is newer than the previous output schema version.
schemaVersion in interface ScanSchemaTrackerschemaVersion in class AbstractSchemaTrackerpublic ProjectedColumn columnProjection(String colName)
ScanSchemaTrackerCopyright © 2021 The Apache Software Foundation. All rights reserved.