Skip to content

Commit c58c4a8

Browse files
committed
Minor PR feedback
1 parent b0efb7b commit c58c4a8

File tree

2 files changed

+158
-158
lines changed

2 files changed

+158
-158
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,6 @@ public enum Cap {
649649
*/
650650
MATCH_FUNCTION,
651651

652-
/**
653-
* MATCH PHRASE function
654-
*/
655-
MATCH_PHRASE_FUNCTION(Build.current().isSnapshot()),
656-
657652
/**
658653
* KQL function
659654
*/
@@ -1084,7 +1079,12 @@ public enum Cap {
10841079
/**
10851080
* Full text functions in STATS
10861081
*/
1087-
FULL_TEXT_FUNCTIONS_IN_STATS_WHERE;
1082+
FULL_TEXT_FUNCTIONS_IN_STATS_WHERE,
1083+
1084+
/**
1085+
* MATCH PHRASE function
1086+
*/
1087+
MATCH_PHRASE_FUNCTION(Build.current().isSnapshot());
10881088

10891089
private final boolean enabled;
10901090

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/60_usage.yml

Lines changed: 152 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ setup:
77
parameters: [ method, path, parameters, capabilities ]
88
capabilities: [ function_stats ]
99
reason: "META command removed which changes the count of the data returned"
10-
test_runner_features: [ capabilities ]
10+
test_runner_features: [capabilities]
1111

1212
- do:
1313
indices.create:
14-
index: test
14+
index: test
1515
body:
1616
settings:
1717
number_of_shards: 1
@@ -27,58 +27,58 @@ setup:
2727
---
2828
"Basic ESQL usage output (telemetry) snapshot version":
2929
- requires:
30-
test_runner_features: [ capabilities ]
30+
test_runner_features: [capabilities]
3131
capabilities:
3232
- method: POST
3333
path: /_query
34-
parameters: [ ]
34+
parameters: []
3535
# A snapshot function was removed in match_function_options, it can't work on mixed cluster tests otherwise.
36-
capabilities: [ snapshot_test_for_telemetry, fn_byte_length, match_function_options, first_over_time ]
36+
capabilities: [ snapshot_test_for_telemetry, fn_byte_length, match_function_options, first_over_time]
3737
reason: "Test that should only be executed on snapshot versions"
3838

39-
- do: { xpack.usage: { } }
39+
- do: {xpack.usage: {}}
4040
- match: { esql.available: true }
4141
- match: { esql.enabled: true }
4242
- length: { esql.features: 26 }
43-
- set: { esql.features.dissect: dissect_counter }
44-
- set: { esql.features.drop: drop_counter }
45-
- set: { esql.features.eval: eval_counter }
46-
- set: { esql.features.enrich: enrich_counter }
47-
- set: { esql.features.from: from_counter }
48-
- set: { esql.features.grok: grok_counter }
49-
- set: { esql.features.keep: keep_counter }
50-
- set: { esql.features.limit: limit_counter }
51-
- set: { esql.features.mv_expand: mv_expand_counter }
52-
- set: { esql.features.rename: rename_counter }
53-
- set: { esql.features.row: row_counter }
54-
- set: { esql.features.show: show_counter }
55-
- set: { esql.features.sort: sort_counter }
56-
- set: { esql.features.stats: stats_counter }
57-
- set: { esql.features.where: where_counter }
58-
- set: { esql.features.lookup_join: lookup_join_counter }
59-
- set: { esql.features.lookup: lookup_counter }
60-
- set: { esql.features.change_point: change_point_counter }
61-
- set: { esql.features.inlinestats: inlinestats_counter }
62-
- set: { esql.features.rerank: rerank_counter }
63-
- set: { esql.features.dedup: dedup_counter }
64-
- set: { esql.features.insist: insist_counter }
65-
- set: { esql.features.fork: fork_counter }
66-
- set: { esql.features.rrf: rrf_counter }
67-
- set: { esql.features.completion: completion_counter }
68-
- set: { esql.features.sample: sample_counter }
43+
- set: {esql.features.dissect: dissect_counter}
44+
- set: {esql.features.drop: drop_counter}
45+
- set: {esql.features.eval: eval_counter}
46+
- set: {esql.features.enrich: enrich_counter}
47+
- set: {esql.features.from: from_counter}
48+
- set: {esql.features.grok: grok_counter}
49+
- set: {esql.features.keep: keep_counter}
50+
- set: {esql.features.limit: limit_counter}
51+
- set: {esql.features.mv_expand: mv_expand_counter}
52+
- set: {esql.features.rename: rename_counter}
53+
- set: {esql.features.row: row_counter}
54+
- set: {esql.features.show: show_counter}
55+
- set: {esql.features.sort: sort_counter}
56+
- set: {esql.features.stats: stats_counter}
57+
- set: {esql.features.where: where_counter}
58+
- set: {esql.features.lookup_join: lookup_join_counter}
59+
- set: {esql.features.lookup: lookup_counter}
60+
- set: {esql.features.change_point: change_point_counter}
61+
- set: {esql.features.inlinestats: inlinestats_counter}
62+
- set: {esql.features.rerank: rerank_counter}
63+
- set: {esql.features.dedup: dedup_counter}
64+
- set: {esql.features.insist: insist_counter}
65+
- set: {esql.features.fork: fork_counter}
66+
- set: {esql.features.rrf: rrf_counter}
67+
- set: {esql.features.completion: completion_counter}
68+
- set: {esql.features.sample: sample_counter}
6969
- length: { esql.queries: 3 }
70-
- set: { esql.queries.rest.total: rest_total_counter }
71-
- set: { esql.queries.rest.failed: rest_failed_counter }
72-
- set: { esql.queries.kibana.total: kibana_total_counter }
73-
- set: { esql.queries.kibana.failed: kibana_failed_counter }
74-
- set: { esql.queries._all.total: all_total_counter }
75-
- set: { esql.queries._all.failed: all_failed_counter }
76-
- set: { esql.functions.max: functions_max }
77-
- set: { esql.functions.min: functions_min }
78-
- set: { esql.functions.cos: functions_cos }
79-
- set: { esql.functions.to_long: functions_to_long }
80-
- set: { esql.functions.coalesce: functions_coalesce }
81-
- set: { esql.functions.categorize: functions_categorize }
70+
- set: {esql.queries.rest.total: rest_total_counter}
71+
- set: {esql.queries.rest.failed: rest_failed_counter}
72+
- set: {esql.queries.kibana.total: kibana_total_counter}
73+
- set: {esql.queries.kibana.failed: kibana_failed_counter}
74+
- set: {esql.queries._all.total: all_total_counter}
75+
- set: {esql.queries._all.failed: all_failed_counter}
76+
- set: {esql.functions.max: functions_max}
77+
- set: {esql.functions.min: functions_min}
78+
- set: {esql.functions.cos: functions_cos}
79+
- set: {esql.functions.to_long: functions_to_long}
80+
- set: {esql.functions.coalesce: functions_coalesce}
81+
- set: {esql.functions.categorize: functions_categorize}
8282

8383
- do:
8484
esql.query:
@@ -89,96 +89,96 @@ setup:
8989
| limit 5
9090
| stats m = max(data) by categorize(message)'
9191

92-
- do: { xpack.usage: { } }
92+
- do: {xpack.usage: {}}
9393
- match: { esql.available: true }
9494
- match: { esql.enabled: true }
95-
- match: { esql.features.dissect: $dissect_counter }
96-
- match: { esql.features.eval: $eval_counter }
97-
- match: { esql.features.grok: $grok_counter }
98-
- gt: { esql.features.limit: $limit_counter }
99-
- gt: { esql.features.sort: $sort_counter }
100-
- gt: { esql.features.stats: $stats_counter }
101-
- gt: { esql.features.where: $where_counter }
102-
- match: { esql.features.lookup_join: $lookup_join_counter }
103-
- match: { esql.features.lookup: $lookup_counter }
104-
- match: { esql.features.change_point: $change_point_counter }
105-
- match: { esql.features.inlinestats: $inlinestats_counter }
106-
- match: { esql.features.rerank: $rerank_counter }
107-
- match: { esql.features.dedup: $dedup_counter }
108-
- match: { esql.features.insist: $insist_counter }
109-
- match: { esql.features.fork: $fork_counter }
110-
- match: { esql.features.rrf: $rrf_counter }
111-
- match: { esql.features.completion: $completion_counter }
112-
- match: { esql.features.sample: $sample_counter }
113-
- gt: { esql.queries.rest.total: $rest_total_counter }
114-
- match: { esql.queries.rest.failed: $rest_failed_counter }
115-
- match: { esql.queries.kibana.total: $kibana_total_counter }
116-
- match: { esql.queries.kibana.failed: $kibana_failed_counter }
117-
- gt: { esql.queries._all.total: $all_total_counter }
118-
- match: { esql.queries._all.failed: $all_failed_counter }
119-
- gt: { esql.functions.max: $functions_max }
120-
- match: { esql.functions.min: $functions_min }
121-
- match: { esql.functions.cos: $functions_cos }
122-
- gt: { esql.functions.to_long: $functions_to_long }
123-
- match: { esql.functions.coalesce: $functions_coalesce }
124-
- gt: { esql.functions.categorize: $functions_categorize }
95+
- match: {esql.features.dissect: $dissect_counter}
96+
- match: {esql.features.eval: $eval_counter}
97+
- match: {esql.features.grok: $grok_counter}
98+
- gt: {esql.features.limit: $limit_counter}
99+
- gt: {esql.features.sort: $sort_counter}
100+
- gt: {esql.features.stats: $stats_counter}
101+
- gt: {esql.features.where: $where_counter}
102+
- match: {esql.features.lookup_join: $lookup_join_counter}
103+
- match: {esql.features.lookup: $lookup_counter}
104+
- match: {esql.features.change_point: $change_point_counter}
105+
- match: {esql.features.inlinestats: $inlinestats_counter}
106+
- match: {esql.features.rerank: $rerank_counter}
107+
- match: {esql.features.dedup: $dedup_counter}
108+
- match: {esql.features.insist: $insist_counter}
109+
- match: {esql.features.fork: $fork_counter}
110+
- match: {esql.features.rrf: $rrf_counter}
111+
- match: {esql.features.completion: $completion_counter}
112+
- match: {esql.features.sample: $sample_counter}
113+
- gt: {esql.queries.rest.total: $rest_total_counter}
114+
- match: {esql.queries.rest.failed: $rest_failed_counter}
115+
- match: {esql.queries.kibana.total: $kibana_total_counter}
116+
- match: {esql.queries.kibana.failed: $kibana_failed_counter}
117+
- gt: {esql.queries._all.total: $all_total_counter}
118+
- match: {esql.queries._all.failed: $all_failed_counter}
119+
- gt: {esql.functions.max: $functions_max}
120+
- match: {esql.functions.min: $functions_min}
121+
- match: {esql.functions.cos: $functions_cos}
122+
- gt: {esql.functions.to_long: $functions_to_long}
123+
- match: {esql.functions.coalesce: $functions_coalesce}
124+
- gt: {esql.functions.categorize: $functions_categorize}
125125
# Testing for the entire function set isn't feasible, so we just check that we return the correct count as an approximation.
126-
- length: { esql.functions: 142 } # check the "sister" test below for a likely update to the same esql.functions length check
126+
- length: {esql.functions: 142} # check the "sister" test below for a likely update to the same esql.functions length check
127127

128128
---
129129
"Basic ESQL usage output (telemetry) non-snapshot version":
130130
- requires:
131-
test_runner_features: [ capabilities ]
131+
test_runner_features: [capabilities]
132132
capabilities:
133133
- method: POST
134134
path: /_query
135-
parameters: [ ]
135+
parameters: []
136136
capabilities: [ non_snapshot_test_for_telemetry, fn_byte_length ]
137137
reason: "Test that should only be executed on release versions"
138138

139-
- do: { xpack.usage: { } }
139+
- do: {xpack.usage: {}}
140140
- match: { esql.available: true }
141141
- match: { esql.enabled: true }
142142
- length: { esql.features: 26 }
143-
- set: { esql.features.dissect: dissect_counter }
144-
- set: { esql.features.drop: drop_counter }
145-
- set: { esql.features.eval: eval_counter }
146-
- set: { esql.features.enrich: enrich_counter }
147-
- set: { esql.features.from: from_counter }
148-
- set: { esql.features.grok: grok_counter }
149-
- set: { esql.features.keep: keep_counter }
150-
- set: { esql.features.limit: limit_counter }
151-
- set: { esql.features.mv_expand: mv_expand_counter }
152-
- set: { esql.features.rename: rename_counter }
153-
- set: { esql.features.row: row_counter }
154-
- set: { esql.features.show: show_counter }
155-
- set: { esql.features.sort: sort_counter }
156-
- set: { esql.features.stats: stats_counter }
157-
- set: { esql.features.where: where_counter }
158-
- set: { esql.features.lookup_join: lookup_join_counter }
159-
- set: { esql.features.lookup: lookup_counter }
160-
- set: { esql.features.change_point: change_point_counter }
161-
- set: { esql.features.inlinestats: inlinestats_counter }
162-
- set: { esql.features.rerank: rerank_counter }
163-
- set: { esql.features.dedup: dedup_counter }
164-
- set: { esql.features.insist: insist_counter }
165-
- set: { esql.features.fork: fork_counter }
166-
- set: { esql.features.rrf: rrf_counter }
167-
- set: { esql.features.completion: completion_counter }
168-
- set: { esql.features.sample: sample_counter }
143+
- set: {esql.features.dissect: dissect_counter}
144+
- set: {esql.features.drop: drop_counter}
145+
- set: {esql.features.eval: eval_counter}
146+
- set: {esql.features.enrich: enrich_counter}
147+
- set: {esql.features.from: from_counter}
148+
- set: {esql.features.grok: grok_counter}
149+
- set: {esql.features.keep: keep_counter}
150+
- set: {esql.features.limit: limit_counter}
151+
- set: {esql.features.mv_expand: mv_expand_counter}
152+
- set: {esql.features.rename: rename_counter}
153+
- set: {esql.features.row: row_counter}
154+
- set: {esql.features.show: show_counter}
155+
- set: {esql.features.sort: sort_counter}
156+
- set: {esql.features.stats: stats_counter}
157+
- set: {esql.features.where: where_counter}
158+
- set: {esql.features.lookup_join: lookup_join_counter}
159+
- set: {esql.features.lookup: lookup_counter}
160+
- set: {esql.features.change_point: change_point_counter}
161+
- set: {esql.features.inlinestats: inlinestats_counter}
162+
- set: {esql.features.rerank: rerank_counter}
163+
- set: {esql.features.dedup: dedup_counter}
164+
- set: {esql.features.insist: insist_counter}
165+
- set: {esql.features.fork: fork_counter}
166+
- set: {esql.features.rrf: rrf_counter}
167+
- set: {esql.features.completion: completion_counter}
168+
- set: {esql.features.sample: sample_counter}
169169
- length: { esql.queries: 3 }
170-
- set: { esql.queries.rest.total: rest_total_counter }
171-
- set: { esql.queries.rest.failed: rest_failed_counter }
172-
- set: { esql.queries.kibana.total: kibana_total_counter }
173-
- set: { esql.queries.kibana.failed: kibana_failed_counter }
174-
- set: { esql.queries._all.total: all_total_counter }
175-
- set: { esql.queries._all.failed: all_failed_counter }
176-
- set: { esql.functions.max: functions_max }
177-
- set: { esql.functions.min: functions_min }
178-
- set: { esql.functions.cos: functions_cos }
179-
- set: { esql.functions.to_long: functions_to_long }
180-
- set: { esql.functions.coalesce: functions_coalesce }
181-
- set: { esql.functions.categorize: functions_categorize }
170+
- set: {esql.queries.rest.total: rest_total_counter}
171+
- set: {esql.queries.rest.failed: rest_failed_counter}
172+
- set: {esql.queries.kibana.total: kibana_total_counter}
173+
- set: {esql.queries.kibana.failed: kibana_failed_counter}
174+
- set: {esql.queries._all.total: all_total_counter}
175+
- set: {esql.queries._all.failed: all_failed_counter}
176+
- set: {esql.functions.max: functions_max}
177+
- set: {esql.functions.min: functions_min}
178+
- set: {esql.functions.cos: functions_cos}
179+
- set: {esql.functions.to_long: functions_to_long}
180+
- set: {esql.functions.coalesce: functions_coalesce}
181+
- set: {esql.functions.categorize: functions_categorize}
182182

183183
- do:
184184
esql.query:
@@ -189,52 +189,52 @@ setup:
189189
| limit 5
190190
| stats m = max(data) by categorize(message)'
191191

192-
- do: { xpack.usage: { } }
192+
- do: {xpack.usage: {}}
193193
- match: { esql.available: true }
194194
- match: { esql.enabled: true }
195-
- match: { esql.features.dissect: $dissect_counter }
196-
- match: { esql.features.eval: $eval_counter }
197-
- match: { esql.features.grok: $grok_counter }
198-
- gt: { esql.features.limit: $limit_counter }
199-
- gt: { esql.features.sort: $sort_counter }
200-
- gt: { esql.features.stats: $stats_counter }
201-
- gt: { esql.features.where: $where_counter }
202-
- match: { esql.features.lookup_join: $lookup_join_counter }
203-
- match: { esql.features.lookup: $lookup_counter }
204-
- match: { esql.features.change_point: $change_point_counter }
205-
- match: { esql.features.inlinestats: $inlinestats_counter }
206-
- match: { esql.features.rerank: $rerank_counter }
207-
- match: { esql.features.dedup: $dedup_counter }
208-
- match: { esql.features.insist: $insist_counter }
209-
- match: { esql.features.fork: $fork_counter }
210-
- match: { esql.features.rrf: $rrf_counter }
211-
- match: { esql.features.completion: $completion_counter }
212-
- gt: { esql.queries.rest.total: $rest_total_counter }
213-
- match: { esql.queries.rest.failed: $rest_failed_counter }
214-
- match: { esql.queries.kibana.total: $kibana_total_counter }
215-
- match: { esql.queries.kibana.failed: $kibana_failed_counter }
216-
- gt: { esql.queries._all.total: $all_total_counter }
217-
- match: { esql.queries._all.failed: $all_failed_counter }
218-
- gt: { esql.functions.max: $functions_max }
219-
- match: { esql.functions.min: $functions_min }
220-
- match: { esql.functions.cos: $functions_cos }
221-
- gt: { esql.functions.to_long: $functions_to_long }
222-
- match: { esql.functions.coalesce: $functions_coalesce }
223-
- gt: { esql.functions.categorize: $functions_categorize }
224-
- length: { esql.functions: 132 } # check the "sister" test above for a likely update to the same esql.functions length check
195+
- match: {esql.features.dissect: $dissect_counter}
196+
- match: {esql.features.eval: $eval_counter}
197+
- match: {esql.features.grok: $grok_counter}
198+
- gt: {esql.features.limit: $limit_counter}
199+
- gt: {esql.features.sort: $sort_counter}
200+
- gt: {esql.features.stats: $stats_counter}
201+
- gt: {esql.features.where: $where_counter}
202+
- match: {esql.features.lookup_join: $lookup_join_counter}
203+
- match: {esql.features.lookup: $lookup_counter}
204+
- match: {esql.features.change_point: $change_point_counter}
205+
- match: {esql.features.inlinestats: $inlinestats_counter}
206+
- match: {esql.features.rerank: $rerank_counter}
207+
- match: {esql.features.dedup: $dedup_counter}
208+
- match: {esql.features.insist: $insist_counter}
209+
- match: {esql.features.fork: $fork_counter}
210+
- match: {esql.features.rrf: $rrf_counter}
211+
- match: {esql.features.completion: $completion_counter}
212+
- gt: {esql.queries.rest.total: $rest_total_counter}
213+
- match: {esql.queries.rest.failed: $rest_failed_counter}
214+
- match: {esql.queries.kibana.total: $kibana_total_counter}
215+
- match: {esql.queries.kibana.failed: $kibana_failed_counter}
216+
- gt: {esql.queries._all.total: $all_total_counter}
217+
- match: {esql.queries._all.failed: $all_failed_counter}
218+
- gt: {esql.functions.max: $functions_max}
219+
- match: {esql.functions.min: $functions_min}
220+
- match: {esql.functions.cos: $functions_cos}
221+
- gt: {esql.functions.to_long: $functions_to_long}
222+
- match: {esql.functions.coalesce: $functions_coalesce}
223+
- gt: {esql.functions.categorize: $functions_categorize}
224+
- length: {esql.functions: 132} # check the "sister" test above for a likely update to the same esql.functions length check
225225

226226
---
227227
took:
228228
- requires:
229-
test_runner_features: [ capabilities ]
229+
test_runner_features: [capabilities]
230230
capabilities:
231231
- method: POST
232232
path: /_query
233-
parameters: [ ]
234-
capabilities: [ usage_contains_took ]
233+
parameters: []
234+
capabilities: [usage_contains_took]
235235
reason: "Test that should only be executed on snapshot versions"
236236

237-
- do: { xpack.usage: { } }
237+
- do: {xpack.usage: {}}
238238
- exists: esql.took.lt_10ms
239239
- exists: esql.took.lt_1s
240240
- exists: esql.took.lt_10s

0 commit comments

Comments
 (0)