Class QueryPragmas
java.lang.Object
org.elasticsearch.xpack.esql.plugin.QueryPragmas
- All Implemented Interfaces:
Writeable
Holds the pragmas for an ESQL query. Just a wrapper of settings for now.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionThe number of branches to execute in parallel.How to cutslicesto cut each shard into.static final QueryPragmasControls how external source queries are distributed across nodes.static final Setting<MappedFieldType.FieldExtractPreference> static final Setting<ByteSizeValue> Whentrue, forces all non-single-segment pages throughValuesFromDocSequenceregardless of the number ofBYTES_REFfields.Query-level override for the IN subquery hash join threshold.Per-file cap on the number of intra-file byte-range segments whose object-store read streams are open at once during parallel text parsing.Query-level override for the maximum number of keyword sort fields allowed when pushing TopN to Lucene.static final Setting<ByteSizeValue> Bytes the streaming external-source parser may buffer for a single record before failing the query — guards against a scanner that never finds a boundary reading the input without bound.Query-level override for the minimum number of docs per Lucene slice (seeLuceneSliceQueue.MIN_DOCS_PER_SLICE).Size of a page in entries with0being a special value asking to adaptively size based on the number of columns in the page.Number of parallel parser threads for intra-file text format parsing (CSV, NDJSON).The maximum number of rounding points to push down to Lucene for theroundTofunction at query level.Whentrue, allows full-text functions to be used with expressions that are not indexed fields.The minimum interval between syncs of theDriverStatus, making the status available to task API. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintdataPartitioning(DataPartitioning defaultDataPartitioning) intdocSequenceBytesRefFieldThreshold(int clusterDefault) Returns the effective doc-sequence threshold.intdocsThresholdForAutoPartitioning(int defaultThreshold) intReturns the maximum number of workers for enrich lookup.booleanintThe default preference for extracting fields, defaults toNONE.The maximum amount of memory we can use forExpression.fold(org.elasticsearch.xpack.esql.core.expression.FoldContext)during planing.inthashCode()booleanisEmpty()intThe maximum number of nodes to be queried at once by this query.intintThe maximum number of shards can be executed concurrently on a single node by this query.intintminDocsPerSlice(int defaultMinDocsPerSlice) Returns the effective minimum number of docs per Lucene slice.booleanReturns true if each data node should perform a local reduction for sort, limit, topN, stats or false if the coordinator node will perform the reduction.intpageSize()Size of a page in entries with0being a special value asking to adaptively size based on the number of columns in the page.intintpartialAggregationEmitKeysThreshold(int defaultThreshold) doublepartialAggregationEmitUniquenessThreshold(double defaultThreshold) intbooleansettings()Returns the underlying settings.The minimum interval between syncs of theDriverStatus, making the status available to task API.intinttimeSeriesTargetChunkRows(int defaultChunkRows) toString()intAmount of attempts moved shards could be retried.voidwriteTo(StreamOutput out)
-
Field Details
-
EXCHANGE_BUFFER_SIZE
-
ENRICH_MAX_WORKERS
-
TASK_CONCURRENCY
-
DATA_PARTITIONING
How to cutslicesto cut each shard into. Is parsed to the enumDataPartitioningwhich has more documentation. Not anSetting.enumSetting(java.lang.Class<T>, java.lang.String, T, org.elasticsearch.common.settings.Setting.Property...)because those can't havenulldefaults.nullhere means "use the default from the cluster setting namedPlannerSettings.DEFAULT_DATA_PARTITIONING." -
PAGE_SIZE
Size of a page in entries with0being a special value asking to adaptively size based on the number of columns in the page. -
STATUS_INTERVAL
The minimum interval between syncs of theDriverStatus, making the status available to task API. -
MAX_CONCURRENT_NODES_PER_CLUSTER
-
MAX_CONCURRENT_SHARDS_PER_NODE
-
UNAVAILABLE_SHARD_RESOLUTION_ATTEMPTS
-
NODE_LEVEL_REDUCTION
-
FOLD_LIMIT
-
FIELD_EXTRACT_PREFERENCE
-
ROUNDTO_PUSHDOWN_THRESHOLD
The maximum number of rounding points to push down to Lucene for theroundTofunction at query level.ReplaceRoundToWithQueryAndTagschecks this threshold before rewritingRoundToto range queries. There is also a cluster level ESQL_ROUNDTO_PUSHDOWN_THRESHOLD defined inEsqlFlags. The query level threshold defaults to -1, which means this query level setting is not set and cluster level upper limit will be used. The cluster level threshold defaults to 127, it is the same as the maximum number of buckets used inRounding. If query level threshold is set to greater than or equals to 0, the query level threshold will be used, and it overrides the cluster level threshold. If the query level threshold is set to 0, noRoundTopushdown will be performed. -
MAX_KEYWORD_SORT_FIELDS
Query-level override for the maximum number of keyword sort fields allowed when pushing TopN to Lucene. Defaults to-1, meaning the cluster-level settingPlannerSettings.MAX_KEYWORD_SORT_FIELDSis used. When set to a value>= 0, it overrides the cluster-level threshold for this query only. The resolution logic lives inPushTopNToSource. -
EXTERNAL_DISTRIBUTION
Controls how external source queries are distributed across nodes. Valid values: "adaptive" (default), "coordinator_only", "round_robin". -
IN_SUBQUERY_HASH_JOIN_THRESHOLD
Query-level override for the IN subquery hash join threshold. Defaults to-1, meaning the cluster-level settingPlannerSettings.IN_SUBQUERY_HASH_JOIN_THRESHOLDis used. When set to a value>= 0, it overrides the cluster-level threshold for this query only. -
BRANCH_PARALLEL_DEGREE
The number of branches to execute in parallel. This is a safeguard to avoid overloading the cluster with too many parallel branches. This applies to forks and subqueries. -
PARSING_PARALLELISM
Number of parallel parser threads for intra-file text format parsing (CSV, NDJSON). Defaults to allocated processors. Set to 1 to disable parallel parsing. -
MAX_CONCURRENT_OPEN_SEGMENTS
Per-file cap on the number of intra-file byte-range segments whose object-store read streams are open at once during parallel text parsing. Each open segment holds a storage read stream (one S3GetObject) plus, for buffering readers like NDJSON, a per-segmentbyte[]; the consumer emits a segment's pages as soon as that segment finishes parsing (completion order, not strict segment order), so this is a shallow read-ahead width, not a parallelism. It is deliberately notparsing_parallelism: a file is already split into aboutparsing_parallelismsegments and many files read concurrently, so aligning this with the thread count would fan a wide multi-file glob into far too many concurrent object-store reads. A small default bounds that fan-out independent of file count/length. Safeguard in the spirit ofBRANCH_PARALLEL_DEGREE.This is a per-file cap. The node-wide bound on concurrently-open segment streams is roughly
(data-node driver instances) × max_concurrent_open_segments × (files open per driver)— tune with that product in mind, not this value alone. The default is sourced fromSourceOperatorContext.DEFAULT_MAX_CONCURRENT_OPEN_SEGMENTS. -
MAX_RECORD_SIZE
Bytes the streaming external-source parser may buffer for a single record before failing the query — guards against a scanner that never finds a boundary reading the input without bound. Defaults toSegmentableFormatReader.DEFAULT_MAX_RECORD_BYTES. Bounded to[1, Integer.MAX_VALUE]bytes: the cap is held as anintdownstream, so an out-of-range value is rejected at parse time rather than overflowing later. -
FORCE_DOC_SEQUENCE
Whentrue, forces all non-single-segment pages throughValuesFromDocSequenceregardless of the number ofBYTES_REFfields. Intended for testing the correctness of doc-sequence loading. -
MIN_DOCS_PER_SLICE
Query-level override for the minimum number of docs per Lucene slice (seeLuceneSliceQueue.MIN_DOCS_PER_SLICE). Defaults to-1, meaning the compute-engine default floor is used. When set to a value> 0, it overrides that floor for this query only.Primarily a testing lever: the default floor collapses small indices to a single slice, which disables
DOC/SEGMENTparallelism in tests that index only a few documents. Lowering it lets such tests exercise the multi-slice partitioning paths. -
RUNTIME_LEXICAL_SEARCH
Whentrue, allows full-text functions to be used with expressions that are not indexed fields. -
EMPTY
-
VALID_PRAGMA_NAMES
-
-
Constructor Details
-
QueryPragmas
-
QueryPragmas
- Throws:
IOException
-
-
Method Details
-
settings
Returns the underlying settings. -
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getSettings
-
exchangeBufferSize
public int exchangeBufferSize() -
concurrentExchangeClients
public int concurrentExchangeClients() -
dataPartitioning
-
taskConcurrency
public int taskConcurrency() -
pageSize
public int pageSize()Size of a page in entries with0being a special value asking to adaptively size based on the number of columns in the page. -
statusInterval
The minimum interval between syncs of theDriverStatus, making the status available to task API. -
enrichMaxWorkers
public int enrichMaxWorkers()Returns the maximum number of workers for enrich lookup. A higher number of workers reduces latency but increases cluster load. Defaults to 1. -
maxConcurrentNodesPerCluster
public int maxConcurrentNodesPerCluster()The maximum number of nodes to be queried at once by this query. This is safeguard to avoid overloading the cluster. -
maxConcurrentShardsPerNode
public int maxConcurrentShardsPerNode()The maximum number of shards can be executed concurrently on a single node by this query. This is a safeguard to avoid opening and holding many shards (equivalent to many file descriptors) or having too many field infos created by a single query. -
nodeLevelReduction
public boolean nodeLevelReduction()Returns true if each data node should perform a local reduction for sort, limit, topN, stats or false if the coordinator node will perform the reduction. -
foldLimit
The maximum amount of memory we can use forExpression.fold(org.elasticsearch.xpack.esql.core.expression.FoldContext)during planing. This defaults to 5% of memory available on the current node. If this method is called on the coordinating node, this is 5% of the coordinating node's memory. If it's called on a data node, it's 5% of the data node. That's an exciting inconsistency. But it's important. Bigger nodes have more space to do folding. -
fieldExtractPreference
The default preference for extracting fields, defaults toNONE. Some fields must be extracted in some special way because of how they are used in the plan. But most fields can be loaded in many ways so they pick the ways that they think are most efficient in theirMappedFieldType.blockLoader(org.elasticsearch.index.mapper.MappedFieldType.BlockLoaderContext)method. This can influence their choice. -
roundToPushDownThreshold
public int roundToPushDownThreshold() -
maxKeywordSortFields
public int maxKeywordSortFields() -
externalDistribution
-
parsingParallelism
public int parsingParallelism() -
maxConcurrentOpenSegments
public int maxConcurrentOpenSegments() -
maxRecordSize
-
branchParallelDegree
public int branchParallelDegree() -
docSequenceBytesRefFieldThreshold
public int docSequenceBytesRefFieldThreshold(int clusterDefault) Returns the effective doc-sequence threshold. WhenFORCE_DOC_SEQUENCEistrue, returns0so that all non-single-segment pages useValuesFromDocSequence; otherwise returnsclusterDefault. -
partialAggregationEmitKeysThreshold
public int partialAggregationEmitKeysThreshold(int defaultThreshold) -
partialAggregationEmitUniquenessThreshold
public double partialAggregationEmitUniquenessThreshold(double defaultThreshold) -
timeSeriesTargetChunkRows
public int timeSeriesTargetChunkRows(int defaultChunkRows) -
docsThresholdForAutoPartitioning
public int docsThresholdForAutoPartitioning(int defaultThreshold) -
minDocsPerSlice
public int minDocsPerSlice(int defaultMinDocsPerSlice) Returns the effective minimum number of docs per Lucene slice. WhenMIN_DOCS_PER_SLICEis set to a positive value it overridesdefaultMinDocsPerSlice; otherwise the default floor is used. -
runtimeLexicalSearch
public boolean runtimeLexicalSearch() -
isEmpty
public boolean isEmpty() -
equals
-
hashCode
public int hashCode() -
toString
-