public class TopNQuery extends AbstractDruidAggregationQuery<TopNQuery>
aggregations, dimensions, postAggregations
filter, granularity, intervals
context, dataSource, queryType
Modifier | Constructor and Description |
---|---|
|
TopNQuery(DataSource dataSource,
Granularity granularity,
Dimension dimension,
Filter filter,
Collection<Aggregation> aggregations,
Collection<PostAggregation> postAggregations,
Collection<org.joda.time.Interval> intervals,
long threshold,
TopNMetric metric)
Constructor.
|
protected |
TopNQuery(DataSource dataSource,
Granularity granularity,
Dimension dimension,
Filter filter,
Collection<Aggregation> aggregations,
Collection<PostAggregation> postAggregations,
Collection<org.joda.time.Interval> intervals,
long threshold,
TopNMetric metric,
QueryContext context,
boolean doFork)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Dimension |
getDimension() |
Collection<Dimension> |
getDimensions()
Returns the dimensions of the query if any.
|
TopNMetric |
getMetric() |
long |
getThreshold() |
TopNQuery |
withAggregations(Collection<Aggregation> aggregations)
Returns a copy of this query with the specified aggregations.
|
TopNQuery |
withAllIntervals(Collection<org.joda.time.Interval> intervals)
Returns a copy of this query with the specified intervals set in this and all inner queries.
|
TopNQuery |
withContext(QueryContext context)
Returns a copy of this query with the specified context.
|
TopNQuery |
withDataSource(DataSource dataSource)
Returns a copy of this query with the specified data source.
|
TopNQuery |
withDimension(Dimension dimension) |
TopNQuery |
withFilter(Filter filter)
Returns a copy of this query with the specified filter.
|
TopNQuery |
withGranularity(Granularity granularity)
Returns a copy of this query with the specified time grain.
|
TopNQuery |
withInnermostDataSource(DataSource dataSource)
Returns a copy of this query with the specified data source on the innermost query.
|
TopNQuery |
withIntervals(Collection<org.joda.time.Interval> intervals)
Returns a copy of this query with the specified intervals.
|
TopNQuery |
withMetric(TopNMetric metric) |
TopNQuery |
withPostAggregations(Collection<PostAggregation> postAggregations)
Returns a copy of this query with the specified post aggregations.
|
getAggregations, getPostAggregations
getFilter, getGranularity, getIntervals
getContext, getDataSource, getQueryType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildSchemaColumns, getDependentFieldNames, getInnermostQuery, getInnerQuery, getMetricDimensions
getFilter, getGranularity, getIntervals
getContext, getDataSource, getQueryType
protected TopNQuery(DataSource dataSource, Granularity granularity, Dimension dimension, Filter filter, Collection<Aggregation> aggregations, Collection<PostAggregation> postAggregations, Collection<org.joda.time.Interval> intervals, long threshold, TopNMetric metric, QueryContext context, boolean doFork)
dataSource
- The datasourcegranularity
- The granularitydimension
- The dimensionfilter
- The filteraggregations
- The aggregationspostAggregations
- The post-aggregationsintervals
- The intervalsthreshold
- The thresholdmetric
- The TopN metriccontext
- The contextdoFork
- true to fork a new context and bump up the query id, or false to create an exact copy of the
context.public TopNQuery(DataSource dataSource, Granularity granularity, Dimension dimension, Filter filter, Collection<Aggregation> aggregations, Collection<PostAggregation> postAggregations, Collection<org.joda.time.Interval> intervals, long threshold, TopNMetric metric)
dataSource
- The datasourcegranularity
- The granularitydimension
- The dimensionfilter
- The filteraggregations
- The aggregationspostAggregations
- The post-aggregationsintervals
- The intervalsthreshold
- The thresholdmetric
- The TopN metricpublic Dimension getDimension()
public Collection<Dimension> getDimensions()
DruidAggregationQuery
getDimensions
in interface DruidAggregationQuery<TopNQuery>
getDimensions
in class AbstractDruidAggregationQuery<TopNQuery>
public long getThreshold()
public TopNMetric getMetric()
public TopNQuery withDataSource(DataSource dataSource)
DruidQuery
dataSource
- the new data sourcepublic TopNQuery withInnermostDataSource(DataSource dataSource)
DruidQuery
dataSource
- the new data sourcepublic TopNQuery withMetric(TopNMetric metric)
public TopNQuery withGranularity(Granularity granularity)
DruidFactQuery
granularity
- the new time grainpublic TopNQuery withFilter(Filter filter)
DruidFactQuery
filter
- the new filterpublic TopNQuery withAggregations(Collection<Aggregation> aggregations)
DruidAggregationQuery
aggregations
- the new aggregationspublic TopNQuery withPostAggregations(Collection<PostAggregation> postAggregations)
DruidAggregationQuery
postAggregations
- the new post aggregationspublic TopNQuery withIntervals(Collection<org.joda.time.Interval> intervals)
DruidFactQuery
intervals
- the new intervalspublic TopNQuery withAllIntervals(Collection<org.joda.time.Interval> intervals)
DruidFactQuery
All nested queries are copies of themselves with the specified intervals set.
intervals
- the new intervalspublic TopNQuery withContext(QueryContext context)
DruidQuery
context
- the new contextCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.