Class ConstantColumnLoader

java.lang.Object
org.apache.drill.exec.physical.impl.scan.project.StaticColumnLoader
org.apache.drill.exec.physical.impl.scan.project.ConstantColumnLoader

public class ConstantColumnLoader extends StaticColumnLoader
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.