-
Notifications
You must be signed in to change notification settings - Fork 25.8k
ES|QL: Named parameters #107029
Copy link
Copy link
Closed
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>enhancementES|QL-uiImpacts ES|QL UIImpacts ES|QL UITeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Metadata
Metadata
Assignees
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>enhancementES|QL-uiImpacts ES|QL UIImpacts ES|QL UITeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
Currently, ES|QL supports positional parameters, which allows the query author to inject variables into the query. This is useful for dashboards, where there are often global parameters, like a time range filter, or a KQL string. However, there's no way to use positional parameters for this, as the dashboard doesn't know with what intent the queries were written.
Named parameters can solve this:
One issue here is that in some cases the variable might be null. Consider
groupingFieldbeing optional. If it were empty, it would lead to a syntactically invalid query:Possibly we can solve this by allowing some kind of syntax for conditional templating: