Class Projections
java.lang.Object
org.apache.drill.exec.physical.resultSet.project.Projections
Converts a projection list passed to an operator into a scan projection list,
coalescing multiple references to the same column into a single reference.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequestedTuple
build
(List<RequestedColumn> projList) Create a requested tuple projection from a rewritten top-level projection list.static boolean
Reports whether the column is a special column which should not be expanded in a wildcard.static RequestedTuple
parse
(Collection<SchemaPath> projList) Parse a projection list.static RequestedTuple
static RequestedTuple
-
Method Details
-
projectAll
-
projectNone
-
parse
Parse a projection list. The list should consist of a list of column names; or wildcards. An empty list means nothing is projected. A null list means everything is projected (that is, a null list here is equivalent to a wildcard in the SELECT statement.)The projection list may include both a wildcard and column names (as in the case of implicit columns.) This results in a final list that both says that everything is projected, and provides the list of columns.
Parsing is used at two different times. First, to parse the list from the physical operator. This has the case above: an explicit wildcard and/or additional columns. Then, this class is used again to prepare the physical projection used when reading. In this case, wildcards should be removed, implicit columns pulled out, and just the list of read-level columns should remain.
- Parameters:
projList
- the list of projected columns, or null if no projection is to be done- Returns:
- a projection set that implements the specified projection
-
build
Create a requested tuple projection from a rewritten top-level projection list. The columns within the list have already been parsed to pick out arrays, maps and scalars. The list must not include the wildcard: a wildcard list must be passed in as a null list. An empty list means project nothing. Null list means project all, else project only the columns in the list.- Parameters:
projList
- top-level, parsed columns- Returns:
- the tuple projection for the top-level row
-
excludeFromWildcard
Reports whether the column is a special column which should not be expanded in a wildcard. Used for specialized columns in readers such as the Log format.
-