Class TopNQuery
- All Implemented Interfaces:
Query<Result<TopNResultValue>>
-
Field Summary
FieldsFields inherited from class org.apache.druid.query.BaseQuery
QUERY_ID, SQL_QUERY_ID, SUB_QUERY_IDFields inherited from interface org.apache.druid.query.Query
DATASOURCE_METADATA, GROUP_BY, SCAN, SEARCH, SEGMENT_METADATA, SELECT, TIME_BOUNDARY, TIMESERIES, UNION_QUERY, WINDOW_OPERATOR -
Constructor Summary
ConstructorsConstructorDescriptionTopNQuery(DataSource dataSource, VirtualColumns virtualColumns, DimensionSpec dimensionSpec, TopNMetricSpec topNMetricSpec, int threshold, QuerySegmentSpec querySegmentSpec, DimFilter dimFilter, Granularity granularity, List<AggregatorFactory> aggregatorSpecs, List<PostAggregator> postAggregatorSpecs, Map<String, Object> context) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the set of columns that this query will need to access out of its datasource.getResultRowSignature(RowSignature.Finalization finalization) intgetType()booleaninthashCode()voidoptimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext) toString()withAggregatorSpecs(List<AggregatorFactory> aggregatorSpecs) withDataSource(DataSource dataSource) withOverriddenContext(Map<String, Object> contextOverrides) withPostAggregatorSpecs(List<PostAggregator> postAggs) withQuerySegmentSpec(QuerySegmentSpec querySegmentSpec) Returns a new query, identical to this one, but with a different associatedQuerySegmentSpec.withThreshold(int threshold) Methods inherited from class org.apache.druid.query.BaseQuery
calculateDuration, checkInterrupted, computeOverriddenContext, computeOverridenContext, context, getContext, getDataSource, getDuration, getGranularity, getId, getIntervals, getQuerySegmentSpec, getResultOrdering, getRunner, getSubQueryId, getTimezone, withId, withSqlQueryId, withSubQueryIdMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.druid.query.Query
getContextBoolean, getContextHumanReadableBytes, getContextValue, getMostSpecificId, getResultRowSignature, getSingleInterval, getSqlQueryId, mayCollapseQueryDataSource, withDefaultSubQueryId, withLane, withPriority
-
Field Details
-
TOPN
- See Also:
-
-
Constructor Details
-
TopNQuery
public TopNQuery(DataSource dataSource, VirtualColumns virtualColumns, DimensionSpec dimensionSpec, TopNMetricSpec topNMetricSpec, int threshold, QuerySegmentSpec querySegmentSpec, DimFilter dimFilter, Granularity granularity, List<AggregatorFactory> aggregatorSpecs, List<PostAggregator> postAggregatorSpecs, Map<String, Object> context)
-
-
Method Details
-
hasFilters
public boolean hasFilters() -
getFilter
-
getType
-
getVirtualColumns
-
getDimensionSpec
-
getTopNMetricSpec
-
getThreshold
public int getThreshold() -
getDimensionsFilter
-
getAggregatorSpecs
-
getPostAggregatorSpecs
-
getRequiredColumns
Description copied from interface:QueryReturns the set of columns that this query will need to access out of its datasource.This method does not "look into" what the datasource itself is doing. For example, if a query is built on a
QueryDataSource, this method will not return the columns used by that subquery. As another example, if a query is built on aJoinDataSource, this method will not return the columns from the underlying datasources that are used by the join condition, unless those columns are also used by this query in other ways.Returns null if the set of required columns cannot be known ahead of time.
-
initTopNAlgorithmSelector
-
getResultRowSignature
-
withQuerySegmentSpec
Description copied from interface:QueryReturns a new query, identical to this one, but with a different associatedQuerySegmentSpec.This often changes the behavior of
Query.getRunner(QuerySegmentWalker), since most queries inherit that method fromBaseQuery, which implements it by callingQuerySegmentSpec.lookup(org.apache.druid.query.Query<T>, org.apache.druid.query.QuerySegmentWalker). -
withDimensionSpec
-
withAggregatorSpecs
-
withPostAggregatorSpecs
-
withDataSource
-
optimizeForSegment
public Query<Result<TopNResultValue>> optimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext) -
withThreshold
-
withOverriddenContext
-
toString
-
equals
- Overrides:
equalsin classBaseQuery<Result<TopNResultValue>>
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseQuery<Result<TopNResultValue>>
-