Class TimeseriesQuery
- java.lang.Object
-
- org.apache.druid.query.BaseQuery<Result<TimeseriesResultValue>>
-
- org.apache.druid.query.timeseries.TimeseriesQuery
-
- All Implemented Interfaces:
Query<Result<TimeseriesResultValue>>
public class TimeseriesQuery extends BaseQuery<Result<TimeseriesResultValue>>
-
-
Field Summary
Fields Modifier and Type Field Description static String
CTX_GRAND_TOTAL
static String
CTX_TIMESTAMP_RESULT_FIELD
static String
SKIP_EMPTY_BUCKETS
-
Fields inherited from class org.apache.druid.query.BaseQuery
QUERY_ID, SQL_QUERY_ID, SUB_QUERY_ID
-
Fields inherited from interface org.apache.druid.query.Query
DATASOURCE_METADATA, GROUP_BY, SCAN, SEARCH, SEGMENT_METADATA, SELECT, TIME_BOUNDARY, TIMESERIES, TOPN, WINDOW_OPERATOR
-
-
Constructor Summary
Constructors Constructor Description TimeseriesQuery(DataSource dataSource, QuerySegmentSpec querySegmentSpec, boolean descending, VirtualColumns virtualColumns, DimFilter dimFilter, Granularity granularity, List<AggregatorFactory> aggregatorSpecs, List<PostAggregator> postAggregatorSpecs, int limit, Map<String,Object> context)
-
Method Summary
-
Methods inherited from class org.apache.druid.query.BaseQuery
checkInterrupted, computeOverriddenContext, computeOverridenContext, context, getContext, getDataSource, getDuration, getGranularity, getId, getIntervals, getQuerySegmentSpec, getQuerySegmentSpecForLookUp, getResultOrdering, getRunner, getSubQueryId, getTimezone, isDescending, withId, withSqlQueryId, withSubQueryId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.druid.query.Query
getContextBoolean, getContextHumanReadableBytes, getContextValue, getMostSpecificId, getSqlQueryId, withDefaultSubQueryId, withLane, withPriority
-
-
-
-
Field Detail
-
CTX_GRAND_TOTAL
public static final String CTX_GRAND_TOTAL
- See Also:
- Constant Field Values
-
SKIP_EMPTY_BUCKETS
public static final String SKIP_EMPTY_BUCKETS
- See Also:
- Constant Field Values
-
CTX_TIMESTAMP_RESULT_FIELD
public static final String CTX_TIMESTAMP_RESULT_FIELD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TimeseriesQuery
public TimeseriesQuery(DataSource dataSource, QuerySegmentSpec querySegmentSpec, boolean descending, VirtualColumns virtualColumns, DimFilter dimFilter, Granularity granularity, List<AggregatorFactory> aggregatorSpecs, List<PostAggregator> postAggregatorSpecs, int limit, Map<String,Object> context)
-
-
Method Detail
-
hasFilters
public boolean hasFilters()
-
getFilter
public DimFilter getFilter()
-
getType
public String getType()
-
getVirtualColumns
public VirtualColumns getVirtualColumns()
-
getDimensionsFilter
public DimFilter getDimensionsFilter()
-
getAggregatorSpecs
public List<AggregatorFactory> getAggregatorSpecs()
-
getPostAggregatorSpecs
public List<PostAggregator> getPostAggregatorSpecs()
-
getLimit
public int getLimit()
-
isGrandTotal
public boolean isGrandTotal()
-
getTimestampResultField
public String getTimestampResultField()
-
isSkipEmptyBuckets
public boolean isSkipEmptyBuckets()
-
getRequiredColumns
@Nullable public Set<String> getRequiredColumns()
Description copied from interface:Query
Returns the set of columns that this query will need to access out of its datasource. This method does not "look into" what the datasource itself is doing. For example, if a query is built on aQueryDataSource
, this method will not return the columns used by that subquery. As another example, if a query is built on aJoinDataSource
, this method will not return the columns from the underlying datasources that are used by the join condition, unless those columns are also used by this query in other ways. Returns null if the set of required columns cannot be known ahead of time.
-
withQuerySegmentSpec
public TimeseriesQuery withQuerySegmentSpec(QuerySegmentSpec querySegmentSpec)
Description copied from interface:Query
Returns a new query, identical to this one, but with a different associatedQuerySegmentSpec
. This often changes the behavior ofQuery.getRunner(QuerySegmentWalker)
, since most queries inherit that method fromBaseQuery
, which implements it by callingQuerySegmentSpec.lookup(org.apache.druid.query.Query<T>, org.apache.druid.query.QuerySegmentWalker)
.
-
withDataSource
public Query<Result<TimeseriesResultValue>> withDataSource(DataSource dataSource)
-
optimizeForSegment
public Query<Result<TimeseriesResultValue>> optimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext)
-
withOverriddenContext
public TimeseriesQuery withOverriddenContext(Map<String,Object> contextOverrides)
-
withDimFilter
public TimeseriesQuery withDimFilter(DimFilter dimFilter)
-
withPostAggregatorSpecs
public TimeseriesQuery withPostAggregatorSpecs(List<PostAggregator> postAggregatorSpecs)
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classBaseQuery<Result<TimeseriesResultValue>>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBaseQuery<Result<TimeseriesResultValue>>
-
-