Class QueryableProjection<T>
CursorHolder
by a CursorFactory.
Projections are a type of invisible materialized view stored inside of a Segment
which can be automatically used if they match the CursorBuildSpec argument passed to
CursorFactory.makeCursorHolder(CursorBuildSpec).
In the most basic sense, a projection consists of:
- the actual underlying projection rows (rowSelector)
- a mapping of CursorBuildSpec columns to underlying projection columns (remapColumns)
- and a modified CursorBuildSpec (cursorBuildSpec)
The getRowSelector() and getCursorBuildSpec() methods can be used by a
CursorFactory to build a CursorHolder for the
projection instead of the base table, and wrapColumnSelectorFactory(ColumnSelectorFactory) and
wrapVectorColumnSelectorFactory(VectorColumnSelectorFactory) can be used to decorate the selector factories
constructed by that CursorHolder whenever it builds a
Cursor or VectorCursor to ensure that all
the selectors needed to satisfy the original CursorBuildSpec are available at the correct names.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionQueryableProjection(CursorBuildSpec cursorBuildSpec, Map<String, String> remapColumns, T rowSelector) -
Method Summary
Modifier and TypeMethodDescriptionThe originalCursorBuildSpecof a query can be modified if a projection matches the query, such as removing virtual columns which have already been pre-computed.Backing storage for the rows of the projection as is appropriate for the type ofCursorFactorywrapColumnSelectorFactory(ColumnSelectorFactory selectorFactory) The projection can contain pre-computed virtual columns or pre-aggregated aggregation columns.wrapVectorColumnSelectorFactory(VectorColumnSelectorFactory selectorFactory) The projection can contain pre-computed virtual columns or pre-aggregated aggregation columns.
-
Constructor Details
-
QueryableProjection
public QueryableProjection(CursorBuildSpec cursorBuildSpec, Map<String, String> remapColumns, T rowSelector)
-
-
Method Details
-
getCursorBuildSpec
The originalCursorBuildSpecof a query can be modified if a projection matches the query, such as removing virtual columns which have already been pre-computed. -
wrapColumnSelectorFactory
The projection can contain pre-computed virtual columns or pre-aggregated aggregation columns. At query time, these are remapped to match the desired names for all equivalent components of theCursorBuildSpec.For example, if the original
CursorBuildSpechas a sum aggregator named 'sum_x' which takes a field 'x' as input, and an equivalent sum aggregation exists on the projection with the name 'xsum' built from the base table column 'x', the wrapped column selector factory will make 'xsum' available as 'sum_x', allowing the query to use the combining aggregator instead of processing the base table for column 'x'. -
wrapVectorColumnSelectorFactory
public VectorColumnSelectorFactory wrapVectorColumnSelectorFactory(VectorColumnSelectorFactory selectorFactory) The projection can contain pre-computed virtual columns or pre-aggregated aggregation columns. At query time, these are remapped to match the desired names for all equivalent components of theCursorBuildSpecFor example, if the original
CursorBuildSpechas a sum aggregator named 'sum_x' which takes a field 'x' as input, and an equivalent sum aggregation exists on the projection with the name 'xsum' built from the base table column 'x', the wrapped column selector factory will make 'xsum' available as 'sum_x', allowing the query to use the combining aggregator instead of processing the base table for column 'x'. -
getRowSelector
Backing storage for the rows of the projection as is appropriate for the type ofCursorFactory
-