Interface RequestedTuple
- All Known Implementing Classes:
ImpliedTupleRequest
,RequestedTupleImpl
public interface RequestedTuple
Represents the set of columns projected for a tuple (row or map.)
Each column may have structure: a set of referenced names or
array indices.
Three variations exist:
- Project all (
ImpliedTupleRequest.ALL_MEMBERS
): used for a tuple when all columns are projected. Example: the root tuple (the row) in a SELECT * query. - Project none (also
ImpliedTupleRequest.NO_MEMBERS
): used when no columns are projected from a tuple, such as when a map itself is not projected, so none of its member columns are projected. - Project some (
RequestedTupleImpl
: used in the SELECT a, c, e case in which the query identifies which columns to project (implicitly leaving out others, such as b and d in our example.)
The result is that each tuple (row and map) has an associated projection set which the code can query to determine if a newly added column is wanted (and so should have a backing vector) or is unwanted (and can just receive a dummy writer.)
Wildcards will set the projection type to ALL
, and will
be retained in the projection list. Retaining the wildcard
is important because multiple consumers insert columns at the
wildcard position. For example:
SELECT filename, *, filepath FROM ...
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildName
(StringBuilder buf) boolean
enforceProjection
(ColumnMetadata columnSchema, CustomErrorContext errorContext) get
(int i) boolean
isEmpty()
Report if the projection is empty as occurs inSELECT COUNT(*) FROM ...
.boolean
isProjected
(String colName) boolean
isProjected
(ColumnMetadata columnSchema) mapProjection
(String colName) int
size()
type()
-
Method Details
-
type
-
size
int size() -
get
-
get
-
isProjected
-
isProjected
-
enforceProjection
-
mapProjection
-
projections
List<RequestedColumn> projections() -
buildName
-
isEmpty
boolean isEmpty()Report if the projection is empty as occurs inSELECT COUNT(*) FROM ...
. This is not the same as asking if this tuple is unprojected, as that concept does not apply to tuples, only to the column that contains the tuple.- Returns:
true
if the projection set is empty
-