Class QuerySettings
java.lang.Object
org.elasticsearch.xpack.esql.plan.QuerySettings
The catalog of registered ES|QL query settings.
Each entry is one fluent declaration. QuerySettingDef carries the schema and the read API;
this class is a list of constants and two utility methods (validate(org.elasticsearch.xpack.esql.plan.EsqlStatement, org.elasticsearch.xpack.esql.plan.SettingsValidationContext) for the in-query SET
pass, resolve(java.util.Map<org.elasticsearch.xpack.esql.plan.QuerySettingDef<?>, java.lang.Object>, org.elasticsearch.xpack.esql.plan.EsqlStatement, org.elasticsearch.xpack.esql.plan.SettingsValidationContext) for the merge step that produces an ResolvedSettings).
Adding a new setting
public static final QuerySettingDef<String> MY_SETTING = QuerySettingDef
.string("my_setting")
.withDefault("foo")
.withRequestBody() // accept under settings.{my_setting}
.build();
Then add the constant to ALL to register it. Read anywhere via
MY_SETTING.get(resolvedSettings).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<QuerySettingDef<?>> The canonical, explicitly-enumerated set of all query settings.static final QuerySettingDef<ApproximationSettings> static final QuerySettingDef<Boolean> static final QuerySettingDef<String> static final QuerySettingDef<ZoneId> static final QuerySettingDef<UnmappedResolution> -
Method Summary
Modifier and TypeMethodDescriptionstatic List<QuerySettingDef<?>> all()All declared settings.static List<QuerySettingDef<?>> applicableIn(boolean isSnapshot, boolean isServerless) The registered settings whose availability matches the supplied snapshot/serverless environment.static QuerySettingDef<?> The setting with this name, ornullif no such setting is declared.static ResolvedSettingsresolve(Map<QuerySettingDef<?>, Object> requestParams, EsqlStatement statement, SettingsValidationContext ctx) Foldsregistry default < request body < in-query SETinto a singleResolvedSettings, applying each setting'sQuerySettingDef.reconciler()at every step.static voidvalidate(EsqlStatement statement, SettingsValidationContext ctx) Validates the in-query SETs.static voidwarnIfDeprecated(QuerySettingDef<?> def) Emits a deprecation warning ifdefis deprecated.
-
Field Details
-
PROJECT_ROUTING
-
TIME_ZONE
-
UNMAPPED_FIELDS
-
COLUMN_METADATA
-
APPROXIMATION
-
ALL
The canonical, explicitly-enumerated set of all query settings. This is the single source of truth — the request parser, the resolver, and telemetry all iterate this list. Add a new setting's constant here when you declare it. Referencing this field initializes the class, so there is no load-order hazard.
-
-
Method Details
-
all
All declared settings. -
lookup
The setting with this name, ornullif no such setting is declared. -
validate
Validates the in-query SETs. An unknown key is a typo the user can act on, so it fails loudly with aParsingException— same as the request-body surface. A known-but-deprecated key is accepted with a deprecation warning (seewarnIfDeprecated(org.elasticsearch.xpack.esql.plan.QuerySettingDef<?>)). Type and availability failures also throw early. -
warnIfDeprecated
Emits a deprecation warning ifdefis deprecated. Called from every settings surface (in-querySET, the request body, and the legacy root aliases) so a deprecated setting warns wherever it is supplied, while still being resolved and applied. Routed throughDeprecationLogger(not a bare response header) so it also lands in the throttled operator-facing deprecation trail, matching how the rest of the module deprecates user-supplied knobs (e.g. the datasourceauthaliases). -
resolve
public static ResolvedSettings resolve(Map<QuerySettingDef<?>, Object> requestParams, @Nullable EsqlStatement statement, SettingsValidationContext ctx) Foldsregistry default < request body < in-query SETinto a singleResolvedSettings, applying each setting'sQuerySettingDef.reconciler()at every step. -
applicableIn
The registered settings whose availability matches the supplied snapshot/serverless environment.
-