The query context is used for various query configuration parameters. The following parameters apply to all queries.
|timeout||Query timeout in millis, beyond which unfinished queries will be cancelled. 0 timeout means |
|priority||Query Priority. Queries with higher priority get precedence for computational resources.|
|queryId||auto-generated||Unique identifier given to this query. If a query ID is set or known, this can be used to cancel the query|
|useCache||Flag indicating whether to leverage the query cache for this query. When set to false, it disables reading from the query cache for this query. When set to true, Apache Druid uses |
|populateCache||Flag indicating whether to save the results of the query to the query cache. Primarily used for debugging. When set to false, it disables saving the results of this query to the query cache. When set to true, Druid uses |
|useResultLevelCache||Flag indicating whether to leverage the result level cache for this query. When set to false, it disables reading from the query cache for this query. When set to true, Druid uses |
|populateResultLevelCache||Flag indicating whether to save the results of the query to the result level cache. Primarily used for debugging. When set to false, it disables saving the results of this query to the query cache. When set to true, Druid uses |
|bySegment||Return "by segment" results. Primarily used for debugging, setting it to |
|finalize||Flag indicating whether to "finalize" aggregation results. Primarily used for debugging. For instance, the |
|chunkPeriod||At the Broker process level, long interval queries (of any type) may be broken into shorter interval queries to parallelize merging more than normal. Broken up queries will use a larger share of cluster resources, but, if you use groupBy "v1, it may be able to complete faster as a result. Use ISO 8601 periods. For example, if this property is set to |
|maxScatterGatherBytes||Maximum number of bytes gathered from data processes such as Historicals and realtime processes to execute a query. This parameter can be used to further reduce |
|maxQueuedBytes||Maximum number of bytes queued per query before exerting backpressure on the channel to the data server. Similar to |
|serializeDateTimeAsLong||If true, DateTime is serialized as long in the result returned by Broker and the data transportation between Broker and compute process|
|serializeDateTimeAsLongInner||If true, DateTime is serialized as long in the data transportation between Broker and compute process|
|enableParallelMerge||Enable parallel result merging on the Broker. Note that |
|parallelMergeParallelism||Maximum number of parallel threads to use for parallel result merging on the Broker. See Broker configuration for more details.|
|parallelMergeInitialYieldRows||Number of rows to yield per ForkJoinPool merge task for parallel result merging on the Broker, before forking off a new task to continue merging sequences. See Broker configuration for more details.|
|parallelMergeSmallBatchRows||Size of result batches to operate on in ForkJoinPool merge tasks for parallel result merging on the Broker. See Broker configuration for more details.|
In addition, some query types offer context parameters specific to that query type.
|minTopNThreshold||The top minTopNThreshold local results from each segment are returned for merging to determine the global topN.|
|skipEmptyBuckets||Disable timeseries zero-filling behavior, so only buckets with results will be returned.|
The GroupBy and Timeseries query types can run in vectorized mode, which speeds up query execution by processing batches of rows at a time. Not all queries can be vectorized. In particular, vectorization currently has the following requirements:
- All query-level filters must either be able to run on bitmap indexes or must offer vectorized row-matchers. These include "selector", "bound", "in", "like", "regex", "search", "and", "or", and "not".
- All filters in filtered aggregators must offer vectorized row-matchers.
- All aggregators must offer vectorized implementations. These include "count", "doubleSum", "floatSum", "longSum", "hyperUnique", and "filtered".
- No virtual columns.
- For GroupBy: All dimension specs must be "default" (no extraction functions or filtered dimension specs).
- For GroupBy: No multi-value dimensions.
- For Timeseries: No "descending" order.
- Only immutable segments (not real-time).
Other query types (like TopN, Scan, Select, and Search) ignore the "vectorize" parameter, and will execute without
vectorization. These query types will ignore the "vectorize" parameter even if it is set to
Vectorization is an alpha-quality feature as of Druid 0.17.0. We heartily welcome any feedback and testing from the community as we work to battle-test it.
|vectorize||Enables or disables vectorized query execution. Possible values are |
|vectorSize||Sets the row batching size for a particular query. This will override |