public class ProjectionSchemaTracker extends AbstractSchemaTracker
ScanSchemaTracker.ProjectionType
errorContext, isResolved, schema
Constructor and Description |
---|
ProjectionSchemaTracker(ScanProjectionParser.ProjectionParseResult parseResult,
boolean allowSchemaChange,
CustomErrorContext errorContext) |
ProjectionSchemaTracker(TupleMetadata definedSchema,
ScanProjectionParser.ProjectionParseResult parseResult,
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 |
applyProvidedSchema(TupleMetadata providedSchema) |
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 reader input schema returned
from
AbstractSchemaTracker.readerInputSchema() . |
applyImplicitCols, checkResolved, errorContext, internalSchema, isResolved, missingColumns, outputSchema, projectionType, readerInputSchema, resolveMissingCols, schemaVersion, validateProjection
public ProjectionSchemaTracker(TupleMetadata definedSchema, ScanProjectionParser.ProjectionParseResult parseResult, CustomErrorContext errorContext)
public ProjectionSchemaTracker(ScanProjectionParser.ProjectionParseResult parseResult, boolean allowSchemaChange, CustomErrorContext errorContext)
public ProjectedColumn columnProjection(String colName)
ScanSchemaTracker
public void applyProvidedSchema(TupleMetadata providedSchema)
public void applyEarlyReaderSchema(TupleMetadata readerSchema)
ScanSchemaTracker
public ProjectionFilter projectionFilter(CustomErrorContext errorContext)
AbstractSchemaTracker.readerInputSchema()
.
m
) allows new members, a specific projection
(m.a, m.b
) does not allow new members.SELECT *
for the first reader,
or schema change is allowed in the second reader), and we have
no columns, then just project everything.Static filters handle the simple "none" and "starting from nothing all" cases. The dynamic schema filter handles the case of existing columns whether dynamic or static.
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.Copyright © 1970 The Apache Software Foundation. All rights reserved.