public class ImplicitColumnManager extends Object implements MetadataManager, ReaderLevelProjection.ReaderProjectionResolver, VectorSource
The lifecycle is that the manager is given the set of files for this scan operator so it can determine the partition depth. (Note that different scans may not agree on the depth. This is a known issue with Drill's implementation.)
Then, at the start of the scan, all projection columns are parsed. This class picks out the file metadata columns.
On each file (on each reader), the columns are "resolved." Here, that means that the columns are filled in with actual values based on the present file.
This is the successor to ColumnExplorer
.
Modifier and Type | Class and Description |
---|---|
static class |
ImplicitColumnManager.ImplicitColumnOptions |
Modifier and Type | Field and Description |
---|---|
static int |
AUTO_PARTITION_DEPTH
Automatically compute partition depth from files.
|
protected Map<String,FileMetadataColumnDefn> |
fileMetadataColIndex |
protected List<FileMetadataColumnDefn> |
implicitColDefns |
protected String |
partitionDesignator |
Constructor and Description |
---|
ImplicitColumnManager(OptionSet optionManager,
ImplicitColumnManager.ImplicitColumnOptions config)
Constructor for
ImplicitColumnManager for managing the insertion of file metadata
(AKA "implicit" and partition) columns. |
ImplicitColumnManager(OptionSet optionManager,
ImplicitColumnManager.ImplicitColumnOptions config,
org.apache.hadoop.fs.FileSystem fs)
Constructor for
ImplicitColumnManager for managing the insertion of file metadata
(AKA "implicit" and partition) columns. |
Modifier and Type | Method and Description |
---|---|
void |
bind(ResultVectorCache vectorCache) |
void |
close()
Event indicating the end of a scan.
|
void |
define()
Define (materialize) the columns which this manager
represents.
|
void |
endFile()
Event indicating the end of a file (or other data source.)
|
FileMetadata |
fileMetadata(org.apache.hadoop.fs.Path filePath) |
List<FileMetadataColumnDefn> |
fileMetadataColDefns() |
boolean |
hasImplicitCols() |
void |
load(int rowCount)
Load data into the custom columns, if needed (such as for
null or implicit columns.)
|
List<MetadataColumn> |
metadataColumns() |
protected ImplicitColumnManager.ImplicitColumnOptions |
options() |
int |
partitionCount() |
String |
partitionName(int partition) |
ScanLevelProjection.ScanProjectionParser |
projectionParser()
Returns the file metadata column parser that:
Picks out the file metadata and partition columns,
Inserts partition columns for a wildcard query, if the
option to do so is set.
|
boolean |
resolveColumn(ColumnProjection col,
ResolvedTuple tuple,
TupleMetadata tableSchema)
Resolves metadata columns to concrete, materialized columns with the
proper value for the present file.
|
ReaderLevelProjection.ReaderProjectionResolver |
resolver() |
void |
startFile(org.apache.hadoop.fs.Path filePath) |
void |
startResolution() |
ValueVector |
vector(int index) |
public static final int AUTO_PARTITION_DEPTH
protected final String partitionDesignator
protected final List<FileMetadataColumnDefn> implicitColDefns
protected final Map<String,FileMetadataColumnDefn> fileMetadataColIndex
public ImplicitColumnManager(OptionSet optionManager, ImplicitColumnManager.ImplicitColumnOptions config, org.apache.hadoop.fs.FileSystem fs)
ImplicitColumnManager
for managing the insertion of file metadata
(AKA "implicit" and partition) columns.optionManager
- access to the options for this query; used
too look up custom names for the metadata columnsconfig
- implicit column optionsfs
- file systempublic ImplicitColumnManager(OptionSet optionManager, ImplicitColumnManager.ImplicitColumnOptions config)
ImplicitColumnManager
for managing the insertion of file metadata
(AKA "implicit" and partition) columns.optionManager
- access to the options for this query; used
too look up custom names for the metadata columnsconfig
- implicit column optionsprotected ImplicitColumnManager.ImplicitColumnOptions options()
public void bind(ResultVectorCache vectorCache)
bind
in interface MetadataManager
public ScanLevelProjection.ScanProjectionParser projectionParser()
projectionParser
in interface MetadataManager
ImplicitColumnManager.ImplicitColumnOptions.useLegacyWildcardExpansion
public FileMetadata fileMetadata(org.apache.hadoop.fs.Path filePath)
public boolean hasImplicitCols()
public String partitionName(int partition)
public List<FileMetadataColumnDefn> fileMetadataColDefns()
public void startFile(org.apache.hadoop.fs.Path filePath)
public ReaderLevelProjection.ReaderProjectionResolver resolver()
resolver
in interface MetadataManager
public void define()
MetadataManager
define
in interface MetadataManager
public void load(int rowCount)
MetadataManager
load
in interface MetadataManager
rowCount
- number of rows read into a batch.public void close()
MetadataManager
close
in interface MetadataManager
public void startResolution()
startResolution
in interface ReaderLevelProjection.ReaderProjectionResolver
public void endFile()
MetadataManager
endFile
in interface MetadataManager
public boolean resolveColumn(ColumnProjection col, ResolvedTuple tuple, TupleMetadata tableSchema)
resolveColumn
in interface ReaderLevelProjection.ReaderProjectionResolver
public ValueVector vector(int index)
vector
in interface VectorSource
public int partitionCount()
public List<MetadataColumn> metadataColumns()
Copyright © 1970 The Apache Software Foundation. All rights reserved.