Class TimeseriesQuery
- All Implemented Interfaces:
Query<Result<TimeseriesResultValue>>
-
Field Summary
FieldsFields inherited from class org.apache.druid.query.BaseQuery
QUERY_ID, SQL_QUERY_ID, SUB_QUERY_IDFields inherited from interface org.apache.druid.query.Query
DATASOURCE_METADATA, GROUP_BY, SCAN, SEARCH, SEGMENT_METADATA, SELECT, TIME_BOUNDARY, TIMESERIES, TOPN, UNION_QUERY, WINDOW_OPERATOR -
Constructor Summary
ConstructorsConstructorDescriptionTimeseriesQuery(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
Modifier and TypeMethodDescriptionbooleanintgetLimit()Returns the set of columns that this query will need to access out of its datasource.com.google.common.collect.Ordering<Result<TimeseriesResultValue>> Default implementation ofQuery.getResultOrdering()that usesOrdering.natural().getResultRowSignature(RowSignature.Finalization finalization) getType()booleaninthashCode()booleanbooleanbooleanoptimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext) toString()withAggregatorSpecs(List<AggregatorFactory> aggregatorSpecs) withDataSource(DataSource dataSource) withDimFilter(DimFilter dimFilter) withOverriddenContext(Map<String, Object> contextOverrides) withPostAggregatorSpecs(List<PostAggregator> postAggregatorSpecs) withQuerySegmentSpec(QuerySegmentSpec querySegmentSpec) Returns a new query, identical to this one, but with a different associatedQuerySegmentSpec.Methods inherited from class org.apache.druid.query.BaseQuery
calculateDuration, checkInterrupted, computeOverriddenContext, computeOverridenContext, context, getContext, getDataSource, getDuration, getGranularity, getId, getIntervals, getQuerySegmentSpec, getRunner, getSubQueryId, getTimezone, withId, withSqlQueryId, withSubQueryIdMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.druid.query.Query
getContextBoolean, getContextHumanReadableBytes, getContextValue, getMostSpecificId, getResultRowSignature, getSingleInterval, getSqlQueryId, mayCollapseQueryDataSource, withDefaultSubQueryId, withLane, withPriority
-
Field Details
-
CTX_GRAND_TOTAL
- See Also:
-
SKIP_EMPTY_BUCKETS
- See Also:
-
CTX_TIMESTAMP_RESULT_FIELD
- See Also:
-
-
Constructor Details
-
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 Details
-
hasFilters
public boolean hasFilters() -
getFilter
-
getType
-
getVirtualColumns
-
getDimensionsFilter
-
getAggregatorSpecs
-
getPostAggregatorSpecs
-
isDescending
public boolean isDescending() -
getLimit
public int getLimit() -
isGrandTotal
public boolean isGrandTotal() -
getTimestampResultField
-
isSkipEmptyBuckets
public boolean isSkipEmptyBuckets() -
getResultRowSignature
-
getRequiredColumns
Description copied from interface:QueryReturns 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 a
QueryDataSource, 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.
-
getResultOrdering
Description copied from class:BaseQueryDefault implementation ofQuery.getResultOrdering()that usesOrdering.natural(). If your query result type T is not Comparable, you must override this method.- Specified by:
getResultOrderingin interfaceQuery<Result<TimeseriesResultValue>>- Overrides:
getResultOrderingin classBaseQuery<Result<TimeseriesResultValue>>
-
withQuerySegmentSpec
Description copied from interface:QueryReturns a new query, identical to this one, but with a different associatedQuerySegmentSpec.This often changes the behavior of
Query.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
-
optimizeForSegment
public Query<Result<TimeseriesResultValue>> optimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext) -
withOverriddenContext
-
withDimFilter
-
withAggregatorSpecs
-
withPostAggregatorSpecs
-
toString
-
equals
- Overrides:
equalsin classBaseQuery<Result<TimeseriesResultValue>>
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseQuery<Result<TimeseriesResultValue>>
-