public class TopNQuery extends BaseQuery<Result<TopNResultValue>>
| Modifier and Type | Field and Description |
|---|---|
static String |
TOPN |
QUERY_ID, SQL_QUERY_ID, SUB_QUERY_IDDATASOURCE_METADATA, GROUP_BY, SCAN, SEARCH, SEGMENT_METADATA, SELECT, TIME_BOUNDARY, TIMESERIES| Constructor and Description |
|---|
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) |
checkInterrupted, computeOverriddenContext, computeOverridenContext, context, getContext, getDataSource, getDuration, getGranularity, getId, getIntervals, getQuerySegmentSpec, getQuerySegmentSpecForLookUp, getResultOrdering, getRunner, getSubQueryId, getTimezone, isDescending, withId, withSqlQueryId, withSubQueryIdclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContextBoolean, getContextHumanReadableBytes, getContextValue, getMostSpecificId, getSqlQueryId, withDefaultSubQueryId, withLane, withPrioritypublic static final String TOPN
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)
public boolean hasFilters()
public DimFilter getFilter()
public String getType()
public VirtualColumns getVirtualColumns()
public DimensionSpec getDimensionSpec()
public TopNMetricSpec getTopNMetricSpec()
public int getThreshold()
public List<AggregatorFactory> getAggregatorSpecs()
public List<PostAggregator> getPostAggregatorSpecs()
@Nullable public Set<String> getRequiredColumns()
QueryQueryDataSource, this method will not return the columns used by that subquery. As another example, if a
query is built on a JoinDataSource, 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.public void initTopNAlgorithmSelector(TopNAlgorithmSelector selector)
public TopNQuery withQuerySegmentSpec(QuerySegmentSpec querySegmentSpec)
QueryQuerySegmentSpec.
This often changes the behavior of Query.getRunner(QuerySegmentWalker), since most queries inherit that method
from BaseQuery, which implements it by calling QuerySegmentSpec.lookup(org.apache.druid.query.Query<T>, org.apache.druid.query.QuerySegmentWalker).public TopNQuery withDimensionSpec(DimensionSpec spec)
public TopNQuery withAggregatorSpecs(List<AggregatorFactory> aggregatorSpecs)
public Query<Result<TopNResultValue>> withDataSource(DataSource dataSource)
public Query<Result<TopNResultValue>> optimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext)
public TopNQuery withThreshold(int threshold)
public boolean equals(Object o)
equals in class BaseQuery<Result<TopNResultValue>>public int hashCode()
hashCode in class BaseQuery<Result<TopNResultValue>>Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.