@Override public TopNQuery withContext(QueryContext context) { return new TopNQuery(getDataSource(), granularity, getDimension(), filter, aggregations, postAggregations, intervals, threshold, metric, context, false); } // CHECKSTYLE:ON
@Override public TopNQuery withInnermostDataSource(DataSource dataSource) { return withDataSource(dataSource); }
@Override public TopNQuery withAllIntervals(Collection<Interval> intervals) { return withIntervals(intervals); }
@Override public TopNQuery withDataSource(DataSource dataSource) { return new TopNQuery(dataSource, granularity, getDimension(), filter, aggregations, postAggregations, intervals, threshold, metric, context, false); }
public TopNQuery withDimension(Dimension dimension) { return new TopNQuery(getDataSource(), granularity, dimension, filter, aggregations, postAggregations, intervals, threshold, metric, context, false); }
TopNQuery topNQuery = (TopNQuery) innerQuery; GroupByQuery transformed = new GroupByQuery( new UnionDataSource(topNQuery.getDataSource().getPhysicalTable()), topNQuery.getGranularity(), topNQuery.getDimensions(), topNQuery.getFilter(), null, aggregations, postAggregations, topNQuery.getIntervals(), null );
TopNQuery topNQuery = (TopNQuery) innerQuery; cardinalityWeight = Math.min( topNQuery.getDimension().getCardinality(), Math.max(topNQuery.getThreshold(), DEFAULT_DRUID_TOP_N_THRESHOLD) ); } else {
return new TopNQuery( buildTableDataSource(table),
@Override public TopNQuery withGranularity(Granularity granularity) { return new TopNQuery(getDataSource(), granularity, getDimension(), filter, aggregations, postAggregations, intervals, threshold, metric, context, false); }
@Override public TopNQuery withFilter(Filter filter) { return new TopNQuery(getDataSource(), granularity, getDimension(), filter, aggregations, postAggregations, intervals, threshold, metric, context, false); }
@Override public TopNQuery withPostAggregations(Collection<PostAggregation> postAggregations) { return new TopNQuery(getDataSource(), granularity, getDimension(), filter, aggregations, postAggregations, intervals, threshold, metric, context, false); }
@Override public TopNQuery withIntervals(Collection<Interval> intervals) { return new TopNQuery(getDataSource(), granularity, getDimension(), filter, aggregations, postAggregations, intervals, threshold, metric, context, true); }
@Override public TopNQuery withAggregations(Collection<Aggregation> aggregations) { return new TopNQuery(getDataSource(), granularity, getDimension(), filter, aggregations, postAggregations, intervals, threshold, metric, context, false); }
public TopNQuery withMetric(TopNMetric metric) { return new TopNQuery(getDataSource(), granularity, getDimension(), filter, aggregations, postAggregations, intervals, threshold, metric, context, false); }