@Override public TimeSeriesQuery withContext(QueryContext context) { return new TimeSeriesQuery(getDataSource(), granularity, filter, aggregations, postAggregations, intervals, context, false); } // CHECKSTYLE:ON
@Override public TimeBoundaryQuery withContext(QueryContext context) { return new TimeBoundaryQuery(getDataSource(), context, false); } }
@Override public TopNQuery withContext(QueryContext context) { return new TopNQuery(getDataSource(), granularity, getDimension(), filter, aggregations, postAggregations, intervals, threshold, metric, context, false); } // CHECKSTYLE:ON
@Override public DruidSearchQuery withContext(QueryContext context) { return new DruidSearchQuery(getDataSource(), getGranularity(), getFilter(), getIntervals(), searchDimensions, query, sort, limit, context, false); } // CHECKSTYLE:ON
/** * Update the postAggregations of the nested inner query. The PostAggregations of the LookbackQuery(outer query) * remain unchanged * * @param postAggregations A Collection of PostAggregations * * @return A LookbackQuery whose datasource is built using the provided postAggregations */ public LookbackQuery withInnerQueryPostAggregations(Collection<PostAggregation> postAggregations) { return new LookbackQuery(new QueryDataSource(getInnerQueryUnchecked().withPostAggregations(postAggregations)), granularity, filter, aggregations, getLookbackPostAggregations(), intervals, context, false, lookbackOffsets, lookbackPrefixes, having, limitSpec); }
@Override public GroupByQuery withContext(QueryContext context) { return new GroupByQuery(getDataSource(), granularity, dimensions, filter, having, aggregations, postAggregations, intervals, limitSpec, context, false); } // CHECKSTYLE:ON
@Override @JsonIgnore public Collection<Dimension> getDimensions() { return getInnerQueryUnchecked().getDimensions(); }
@Override @JsonIgnore public Filter getFilter() { return getInnerQueryUnchecked().getFilter(); }
@Override @JsonIgnore public List<Interval> getIntervals() { return getInnerQueryUnchecked().getIntervals(); }
@Override @JsonIgnore public Granularity getGranularity() { return getInnerQueryUnchecked().getGranularity(); }
@Override @JsonIgnore public Set<Aggregation> getAggregations() { return getInnerQueryUnchecked().getAggregations(); }
/** * Returns a copy of this query with the specified intervals. * * @param intervals the new intervals * * @return the query copy */ public SegmentMetadataQuery withIntervals(Collection<Interval> intervals) { return new SegmentMetadataQuery(getDataSource(), intervals); } }
/** * Update the postAggregations of the LookbackQuery(outer query). * * @param postAggregations A Collection of PostAggregations * * @return A LookbackQuery built using the provided postAggregations */ public LookbackQuery withLookbackQueryPostAggregations(Collection<PostAggregation> postAggregations) { return new LookbackQuery(dataSource, granularity, filter, aggregations, postAggregations, intervals, context, false, lookbackOffsets, lookbackPrefixes, having, limitSpec); }
/** * Produce the schema-defining columns for a given druid query. * * @param druidQuery The query being modelled. * * @return A stream of columns based on the signature of the Druid Query. */ public Stream<Column> buildSchemaColumns(DruidAggregationQuery<?> druidQuery) { // Pass through to druid query to allow for possible behavior customization on injected DruidResponseParsers. return druidQuery.buildSchemaColumns(); } }
/** * Get the weight check query for the given query. * * @param druidQuery Druid query to convert to a weight check query * * @return the converted query */ public WeightEvaluationQuery makeWeightEvaluationQuery(DruidAggregationQuery<?> druidQuery) { return WeightEvaluationQuery.makeWeightEvaluationQuery(druidQuery); } }
@Override public TemplateDruidQuery getInnermostQuery() { return (TemplateDruidQuery) DruidAggregationQuery.super.getInnermostQuery(); }
@Override public DruidSearchQuery withInnermostDataSource(DataSource dataSource) { return withDataSource(dataSource); }
@Override public TimeBoundaryQuery withDataSource(DataSource dataSource) { return new TimeBoundaryQuery(dataSource); }
@Override public TimeSeriesQuery withAggregations(Collection<Aggregation> aggregations) { return new TimeSeriesQuery(getDataSource(), granularity, filter, aggregations, postAggregations, intervals, context, false); }
@Override public LookbackQuery withDataSource(DataSource dataSource) { return new LookbackQuery(dataSource, granularity, filter, aggregations, postAggregations, intervals, context, false, lookbackOffsets, lookbackPrefixes, having, limitSpec); }