| Modifier and Type | Class and Description |
|---|---|
static class |
GroupByQuery.Builder |
| Modifier and Type | Field and Description |
|---|---|
static String |
CTX_KEY_SORT_BY_DIMS_FIRST |
QUERY_ID, SQL_QUERY_ID, SUB_QUERY_IDDATASOURCE_METADATA, GROUP_BY, SCAN, SEARCH, SEGMENT_METADATA, SELECT, TIME_BOUNDARY, TIMESERIES, TOPN| Constructor and Description |
|---|
GroupByQuery(DataSource dataSource,
QuerySegmentSpec querySegmentSpec,
VirtualColumns virtualColumns,
DimFilter dimFilter,
Granularity granularity,
List<DimensionSpec> dimensions,
List<AggregatorFactory> aggregatorSpecs,
List<PostAggregator> postAggregatorSpecs,
HavingSpec havingSpec,
LimitSpec limitSpec,
List<List<String>> subtotalsSpec,
Map<String,Object> context) |
| Modifier and Type | Method and Description |
|---|---|
static GroupByQuery.Builder |
builder() |
boolean |
equals(Object o) |
List<AggregatorFactory> |
getAggregatorSpecs() |
boolean |
getApplyLimitPushDownFromContext() |
boolean |
getContextSortByDimsFirst() |
List<DimensionSpec> |
getDimensions() |
DimFilter |
getDimFilter() |
DimFilter |
getFilter() |
HavingSpec |
getHavingSpec() |
LimitSpec |
getLimitSpec() |
List<PostAggregator> |
getPostAggregatorSpecs() |
com.google.common.collect.Ordering |
getResultOrdering()
Default implementation of
Query.getResultOrdering() that uses Ordering.natural(). |
int |
getResultRowAggregatorStart()
Returns the position of the first aggregator in ResultRows for this query.
|
int |
getResultRowDimensionStart()
Returns the position of the first dimension in ResultRows for this query.
|
boolean |
getResultRowHasTimestamp()
Returns true if ResultRows for this query include timestamps, false otherwise.
|
int |
getResultRowPostAggregatorStart()
Returns the position of the first post-aggregator in ResultRows for this query.
|
RowSignature |
getResultRowSignature()
Returns a list of field names, of the same size as
getResultRowSizeWithPostAggregators(), in the
order that they will appear in ResultRows for this query. |
int |
getResultRowSizeWithoutPostAggregators()
Returns the size of ResultRows for this query when they do not include post-aggregators.
|
int |
getResultRowSizeWithPostAggregators()
Returns the size of ResultRows for this query when they include post-aggregators.
|
com.google.common.collect.Ordering<ResultRow> |
getRowOrdering(boolean granular) |
List<List<String>> |
getSubtotalsSpec() |
String |
getType() |
org.joda.time.DateTime |
getUniversalTimestamp()
If this query has a single universal timestamp, return it.
|
VirtualColumns |
getVirtualColumns() |
boolean |
hasFilters() |
int |
hashCode() |
boolean |
isApplyLimitPushDown() |
Sequence<ResultRow> |
postProcess(Sequence<ResultRow> results)
Apply the havingSpec and limitSpec.
|
String |
toString() |
GroupByQuery |
withAggregatorSpecs(List<AggregatorFactory> aggregatorSpecs) |
Query<ResultRow> |
withDataSource(DataSource dataSource) |
GroupByQuery |
withDimensionSpecs(List<DimensionSpec> dimensionSpecs) |
GroupByQuery |
withDimFilter(DimFilter dimFilter) |
GroupByQuery |
withLimitSpec(LimitSpec limitSpec) |
GroupByQuery |
withOverriddenContext(Map<String,Object> contextOverride) |
GroupByQuery |
withPostAggregatorSpecs(List<PostAggregator> postAggregatorSpecs) |
GroupByQuery |
withQuerySegmentSpec(QuerySegmentSpec spec)
Returns a new query, identical to this one, but with a different associated
QuerySegmentSpec. |
GroupByQuery |
withSubtotalsSpec(List<List<String>> subtotalsSpec) |
GroupByQuery |
withVirtualColumns(VirtualColumns virtualColumns) |
checkInterrupted, computeOverriddenContext, computeOverridenContext, getContext, getContextBoolean, getContextValue, getContextValue, getDataSource, getDuration, getGranularity, getId, getIntervals, getQuerySegmentSpec, getQuerySegmentSpecForLookUp, getRunner, getSqlQueryId, getSubQueryId, getTimezone, isDescending, withId, withSqlQueryId, withSubQueryIdclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMostSpecificId, optimizeForSegment, withDefaultSubQueryId, withLane, withPrioritypublic static final String CTX_KEY_SORT_BY_DIMS_FIRST
public GroupByQuery(DataSource dataSource, QuerySegmentSpec querySegmentSpec, VirtualColumns virtualColumns, @Nullable DimFilter dimFilter, Granularity granularity, List<DimensionSpec> dimensions, List<AggregatorFactory> aggregatorSpecs, List<PostAggregator> postAggregatorSpecs, @Nullable HavingSpec havingSpec, LimitSpec limitSpec, @Nullable List<List<String>> subtotalsSpec, Map<String,Object> context)
public static GroupByQuery.Builder builder()
public VirtualColumns getVirtualColumns()
public List<DimensionSpec> getDimensions()
public List<AggregatorFactory> getAggregatorSpecs()
public List<PostAggregator> getPostAggregatorSpecs()
public HavingSpec getHavingSpec()
public LimitSpec getLimitSpec()
public RowSignature getResultRowSignature()
getResultRowSizeWithPostAggregators(), in the
order that they will appear in ResultRows for this query.public int getResultRowSizeWithoutPostAggregators()
public int getResultRowSizeWithPostAggregators()
@Nullable public org.joda.time.DateTime getUniversalTimestamp()
getResultRowHasTimestamp() will return true. The reverse is also true:
if this method returns nonnull, then getResultRowHasTimestamp() will return false.public boolean getResultRowHasTimestamp()
public int getResultRowDimensionStart()
public int getResultRowAggregatorStart()
public int getResultRowPostAggregatorStart()
public boolean hasFilters()
public String getType()
public boolean getContextSortByDimsFirst()
public boolean isApplyLimitPushDown()
public boolean getApplyLimitPushDownFromContext()
public com.google.common.collect.Ordering getResultOrdering()
BaseQueryQuery.getResultOrdering() that uses Ordering.natural().
If your query result type T is not Comparable, you must override this method.getResultOrdering in interface Query<ResultRow>getResultOrdering in class BaseQuery<ResultRow>public com.google.common.collect.Ordering<ResultRow> getRowOrdering(boolean granular)
public Sequence<ResultRow> postProcess(Sequence<ResultRow> results)
results - sequence of rows to apply havingSpec and limitSpec topublic GroupByQuery withOverriddenContext(Map<String,Object> contextOverride)
public GroupByQuery withQuerySegmentSpec(QuerySegmentSpec spec)
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 GroupByQuery withVirtualColumns(VirtualColumns virtualColumns)
public GroupByQuery withDimFilter(@Nullable DimFilter dimFilter)
public Query<ResultRow> withDataSource(DataSource dataSource)
public GroupByQuery withDimensionSpecs(List<DimensionSpec> dimensionSpecs)
public GroupByQuery withLimitSpec(LimitSpec limitSpec)
public GroupByQuery withAggregatorSpecs(List<AggregatorFactory> aggregatorSpecs)
public GroupByQuery withSubtotalsSpec(@Nullable List<List<String>> subtotalsSpec)
public GroupByQuery withPostAggregatorSpecs(List<PostAggregator> postAggregatorSpecs)
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.