public class LookbackQuery extends AbstractDruidAggregationQuery<LookbackQuery>
Modifier and Type | Class and Description |
---|---|
static class |
LookbackQuery.LookbackQueryRequestedIntervalsFunction
The function to get requestedIntervals from a LookbackQuery.
|
aggregations, dimensions, postAggregations
filter, granularity, intervals
context, dataSource, queryType
Constructor and Description |
---|
LookbackQuery(DataSource dataSource,
Collection<PostAggregation> postAggregations,
QueryContext context,
Collection<org.joda.time.Period> lookbackOffsets,
Collection<String> lookbackPrefixes,
Having having,
LimitSpec limitSpec)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Set<Aggregation> |
getAggregations()
Returns the aggregations of the query.
|
Collection<Dimension> |
getDimensions()
Returns the dimensions of the query if any.
|
Filter |
getFilter()
Returns the filter object of the query.
|
Granularity |
getGranularity()
Returns the time grain (granularity) of the query.
|
Having |
getHaving() |
Optional<? extends DruidAggregationQuery> |
getInnerQuery()
If this query is nestable, and has a nested query return it.
|
List<org.joda.time.Interval> |
getIntervals()
Returns the intervals of the query.
|
LimitSpec |
getLimitSpec() |
List<String> |
getlookbackOffsets()
Get the collection of lookback offsets.
|
Collection<org.joda.time.Period> |
getLookbackOffsets() |
Collection<PostAggregation> |
getLookbackPostAggregations() |
Collection<String> |
getLookbackPrefixes() |
Collection<PostAggregation> |
getPostAggregations()
Returns the post-aggregations of the query.
|
LookbackQuery |
withAggregations(Collection<Aggregation> aggregations)
Returns a copy of this query with the specified aggregations.
|
LookbackQuery |
withAllIntervals(Collection<org.joda.time.Interval> intervals)
Returns a copy of this query with the specified intervals set in this and all inner queries.
|
LookbackQuery |
withContext(QueryContext context)
Returns a copy of this query with the specified context.
|
LookbackQuery |
withDataSource(DataSource dataSource)
Returns a copy of this query with the specified data source.
|
LookbackQuery |
withFilter(Filter filter)
Returns a copy of this query with the specified filter.
|
LookbackQuery |
withGranularity(Granularity granularity)
Returns a copy of this query with the specified time grain.
|
LookbackQuery |
withHaving(Having having) |
LookbackQuery |
withInnermostDataSource(DataSource dataSource)
Returns a copy of this query with the specified data source on the innermost query.
|
LookbackQuery |
withInnerQueryPostAggregations(Collection<PostAggregation> postAggregations)
Update the postAggregations of the nested inner query.
|
LookbackQuery |
withIntervals(Collection<org.joda.time.Interval> intervals)
Returns a copy of this query with the specified intervals.
|
LookbackQuery |
withLookbackOffsets(List<org.joda.time.Period> lookbackOffsets) |
LookbackQuery |
withLookbackPrefix(List<String> lookbackPrefixes) |
LookbackQuery |
withLookbackQueryPostAggregations(Collection<PostAggregation> postAggregations)
Update the postAggregations of the LookbackQuery(outer query).
|
LookbackQuery |
withOrderBy(LimitSpec limitSpec) |
LookbackQuery |
withPostAggregations(Collection<PostAggregation> postAggregations)
Returns a copy of this query with the specified post aggregations.
|
getContext, getDataSource, getQueryType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildSchemaColumns, getDependentFieldNames, getInnermostQuery, getMetricDimensions
getContext, getDataSource, getQueryType
public LookbackQuery(DataSource dataSource, Collection<PostAggregation> postAggregations, QueryContext context, Collection<org.joda.time.Period> lookbackOffsets, Collection<String> lookbackPrefixes, Having having, LimitSpec limitSpec)
dataSource
- DataSource for the querypostAggregations
- Post-aggregation operation trees for the querycontext
- Query contextlookbackOffsets
- Set of period offsetslookbackPrefixes
- Set of prefixes for the lookback queries (should match the lookbackOffsets)having
- Having clause to apply to the result querylimitSpec
- Limit spec to apply to the result querypublic Optional<? extends DruidAggregationQuery> getInnerQuery()
DruidQuery
public Having getHaving()
public LimitSpec getLimitSpec()
public Collection<String> getLookbackPrefixes()
public Collection<org.joda.time.Period> getLookbackOffsets()
public List<String> getlookbackOffsets()
public Granularity getGranularity()
DruidFactQuery
getGranularity
in interface DruidFactQuery<LookbackQuery>
getGranularity
in class AbstractDruidFactQuery<LookbackQuery>
public Set<Aggregation> getAggregations()
DruidAggregationQuery
getAggregations
in interface DruidAggregationQuery<LookbackQuery>
getAggregations
in class AbstractDruidAggregationQuery<LookbackQuery>
public Filter getFilter()
DruidFactQuery
getFilter
in interface DruidFactQuery<LookbackQuery>
getFilter
in class AbstractDruidFactQuery<LookbackQuery>
public List<org.joda.time.Interval> getIntervals()
DruidFactQuery
getIntervals
in interface DruidFactQuery<LookbackQuery>
getIntervals
in class AbstractDruidFactQuery<LookbackQuery>
public Collection<Dimension> getDimensions()
DruidAggregationQuery
getDimensions
in interface DruidAggregationQuery<LookbackQuery>
getDimensions
in class AbstractDruidAggregationQuery<LookbackQuery>
public Collection<PostAggregation> getLookbackPostAggregations()
public Collection<PostAggregation> getPostAggregations()
DruidAggregationQuery
getPostAggregations
in interface DruidAggregationQuery<LookbackQuery>
getPostAggregations
in class AbstractDruidAggregationQuery<LookbackQuery>
public LookbackQuery withAggregations(Collection<Aggregation> aggregations)
DruidAggregationQuery
aggregations
- the new aggregationspublic LookbackQuery withPostAggregations(Collection<PostAggregation> postAggregations)
DruidAggregationQuery
postAggregations
- the new post aggregationspublic LookbackQuery withInnerQueryPostAggregations(Collection<PostAggregation> postAggregations)
postAggregations
- A Collection of PostAggregationspublic LookbackQuery withLookbackQueryPostAggregations(Collection<PostAggregation> postAggregations)
postAggregations
- A Collection of PostAggregationspublic LookbackQuery withGranularity(Granularity granularity)
DruidFactQuery
granularity
- the new time grainpublic LookbackQuery withFilter(Filter filter)
DruidFactQuery
filter
- the new filterpublic LookbackQuery withIntervals(Collection<org.joda.time.Interval> intervals)
DruidFactQuery
intervals
- the new intervalspublic LookbackQuery withAllIntervals(Collection<org.joda.time.Interval> intervals)
DruidFactQuery
All nested queries are copies of themselves with the specified intervals set.
intervals
- the new intervalspublic LookbackQuery withDataSource(DataSource dataSource)
DruidQuery
dataSource
- the new data sourcepublic LookbackQuery withInnermostDataSource(DataSource dataSource)
DruidQuery
dataSource
- the new data sourcepublic LookbackQuery withContext(QueryContext context)
DruidQuery
context
- the new contextpublic LookbackQuery withOrderBy(LimitSpec limitSpec)
public LookbackQuery withHaving(Having having)
public LookbackQuery withLookbackPrefix(List<String> lookbackPrefixes)
public LookbackQuery withLookbackOffsets(List<org.joda.time.Period> lookbackOffsets)
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.