Class AggregateProjectionSchema
java.lang.Object
org.apache.druid.segment.projections.AggregateProjectionSchema
- All Implemented Interfaces:
ProjectionSchema
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<AggregateProjectionSchema>It is not likely the best way to find the best matching projections, but it is the one we have for now. -
Constructor Summary
ConstructorsConstructorDescriptionAggregateProjectionSchema(String name, String timeColumnName, DimFilter filter, VirtualColumns virtualColumns, List<String> groupingColumns, AggregatorFactory[] aggregators, List<OrderBy> ordering) -
Method Summary
Modifier and TypeMethodDescriptionbooleanIfProjectionSchema.getTimeColumnName()references a column inProjectionSchema.getVirtualColumns()which is a time_floor expression, this method translates it into aGranularity.getName()Projection sort orderProjection sort order withProjectionSchema.getTimeColumnName()substituted withColumnHolder.TIME_COLUMN_NAMEintThe position of the time column in the column listinthashCode()booleanisInvalidGrouping(String columnName) Check if a column is either part ofgroupingColumns, or at least is not present invirtualColumns.schemaBuilder(String name) toString()
-
Field Details
-
COMPARATOR
It is not likely the best way to find the best matching projections, but it is the one we have for now. This comparator is used to sort all the projections in a segment "best" first, where best is defined as fewest grouping columns, most virtual columns and aggregators, as an approximation of likely to have the fewest number of rows to scan.
-
-
Constructor Details
-
AggregateProjectionSchema
public AggregateProjectionSchema(String name, @Nullable String timeColumnName, @Nullable DimFilter filter, @Nullable VirtualColumns virtualColumns, @Nullable List<String> groupingColumns, @Nullable AggregatorFactory[] aggregators, List<OrderBy> ordering)
-
-
Method Details
-
schemaBuilder
-
getColumnNames
- Specified by:
getColumnNamesin interfaceProjectionSchema
-
getName
- Specified by:
getNamein interfaceProjectionSchema
-
getTimeColumnName
- Specified by:
getTimeColumnNamein interfaceProjectionSchema
-
getFilter
-
getVirtualColumns
- Specified by:
getVirtualColumnsin interfaceProjectionSchema
-
getGroupingColumns
-
getAggregators
-
getOrdering
Description copied from interface:ProjectionSchemaProjection sort order- Specified by:
getOrderingin interfaceProjectionSchema
-
getOrderingWithTimeColumnSubstitution
Description copied from interface:ProjectionSchemaProjection sort order withProjectionSchema.getTimeColumnName()substituted withColumnHolder.TIME_COLUMN_NAME- Specified by:
getOrderingWithTimeColumnSubstitutionin interfaceProjectionSchema
-
getTimeColumnPosition
public int getTimeColumnPosition()Description copied from interface:ProjectionSchemaThe position of the time column in the column list- Specified by:
getTimeColumnPositionin interfaceProjectionSchema
-
getEffectiveGranularity
Description copied from interface:ProjectionSchemaIfProjectionSchema.getTimeColumnName()references a column inProjectionSchema.getVirtualColumns()which is a time_floor expression, this method translates it into aGranularity.- Specified by:
getEffectiveGranularityin interfaceProjectionSchema
-
isInvalidGrouping
Check if a column is either part ofgroupingColumns, or at least is not present invirtualColumns. Naively, we would just check that grouping column contains the column in question, however, we can also use a projection when a column is truly missing.Projections.matchAggregateProjection(AggregateProjectionSchema, CursorBuildSpec, Interval, Projections.PhysicalColumnChecker)returns a match builder if the column is present as either a physical column, or a virtual column, but a virtual column could also be present for an aggregator input, so we must further check that a column not in the grouping list is also not a virtual column, the implication being that it is a missing column. -
equals
-
hashCode
public int hashCode() -
toString
-