Class ConstantColumnLoader
java.lang.Object
org.apache.drill.exec.physical.impl.scan.project.StaticColumnLoader
org.apache.drill.exec.physical.impl.scan.project.ConstantColumnLoader
Populate metadata columns either file metadata (AKA "implicit
columns") or directory metadata (AKA "partition columns.") In both
cases the column type is nullable Varchar and the column value
is predefined by the projection planner; this class just copies
that value into each row.
The values for the columns appear in the column definitions. This works because the metadata columns are re-resolved for for each file, picking up file-specific values. In some cases, a column might not even have a value (such as a reference to a dirN level that isn't defined for a particular file.
That said, this class is agnostic about the source and meaning of the columns: it only cares that the columns are of type nullable Varchar and that the values are in the column nodes.
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.apache.drill.exec.physical.impl.scan.project.StaticColumnLoader
loader, vectorCache
-
Constructor Summary
ConstructorDescriptionConstantColumnLoader
(ResultVectorCache vectorCache, List<? extends ConstantColumnLoader.ConstantColumnSpec> defns) -
Method Summary
Modifier and TypeMethodDescriptionList<? extends ConstantColumnLoader.ConstantColumnSpec>
columns()
load
(int rowCount) Populate static vectors with the defined static values.Methods inherited from class org.apache.drill.exec.physical.impl.scan.project.StaticColumnLoader
close
-
Constructor Details
-
ConstantColumnLoader
public ConstantColumnLoader(ResultVectorCache vectorCache, List<? extends ConstantColumnLoader.ConstantColumnSpec> defns)
-
-
Method Details
-
load
Description copied from class:StaticColumnLoader
Populate static vectors with the defined static values.- Specified by:
load
in classStaticColumnLoader
- Parameters:
rowCount
- number of rows to generate. Must match the row count in the batch returned by the reader
-
columns
-