Skip to content

Commit e723ae6

Browse files
committed
Remove casting on match query side
1 parent 9060cba commit e723ae6

File tree

8 files changed

+696
-845
lines changed

8 files changed

+696
-845
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-function.csv-spec

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -198,42 +198,6 @@ emp_no:integer | first_name:keyword | last_name:keyword
198198
10043 | Yishay | Tzvieli
199199
;
200200

201-
testMatchIpField
202-
required_capability: match_function
203-
required_capability: match_additional_types
204-
205-
from sample_data
206-
| where match(client_ip, "172.21.0.5"::IP)
207-
| keep client_ip, message;
208-
209-
client_ip:ip | message:keyword
210-
172.21.0.5 | Disconnected
211-
;
212-
213-
testMatchDateField
214-
required_capability: match_function
215-
required_capability: match_additional_types
216-
217-
from date_nanos
218-
| where match(millis, "2023-10-23T13:55:01.543Z"::DATETIME)
219-
| keep millis;
220-
221-
millis:date
222-
2023-10-23T13:55:01.543Z
223-
;
224-
225-
testMatchDateNanosField
226-
required_capability: match_function
227-
required_capability: match_additional_types
228-
229-
from date_nanos
230-
| where match(nanos, "2023-10-23T13:55:01.543123456Z"::DATE_NANOS)
231-
| keep nanos;
232-
233-
nanos:date_nanos
234-
2023-10-23T13:55:01.543123456Z
235-
;
236-
237201
testMatchBooleanField
238202
required_capability: match_function
239203
required_capability: match_additional_types
@@ -291,7 +255,7 @@ required_capability: match_function
291255
required_capability: match_additional_types
292256

293257
from ul_logs
294-
| where match(bytes_out, "12749081495402663265"::UNSIGNED_LONG)
258+
| where match(bytes_out, 12749081495402663265)
295259
| keep bytes_out;
296260

297261
bytes_out:unsigned_long
@@ -310,7 +274,7 @@ name:keyword | version:version
310274
bbbbb | 2.1
311275
;
312276

313-
testMatchIpFieldAsString
277+
testMatchIpField
314278
required_capability: match_function
315279
required_capability: match_additional_types
316280

x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-operator.csv-spec

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -218,42 +218,6 @@ count(*): long | author.keyword:keyword
218218
8 | William Faulkner
219219
;
220220

221-
testMatchIpField
222-
required_capability: match_function
223-
required_capability: match_additional_types
224-
225-
from sample_data
226-
| where client_ip:"172.21.0.5"::IP
227-
| keep client_ip, message;
228-
229-
client_ip:ip | message:keyword
230-
172.21.0.5 | Disconnected
231-
;
232-
233-
testMatchDateField
234-
required_capability: match_function
235-
required_capability: match_additional_types
236-
237-
from date_nanos
238-
| where millis:"2023-10-23T13:55:01.543Z"::DATETIME
239-
| keep millis;
240-
241-
millis:date
242-
2023-10-23T13:55:01.543Z
243-
;
244-
245-
testMatchDateNanosField
246-
required_capability: match_function
247-
required_capability: match_additional_types
248-
249-
from date_nanos
250-
| where nanos:"2023-10-23T13:55:01.543123456Z"::DATE_NANOS
251-
| keep nanos;
252-
253-
nanos:date_nanos
254-
2023-10-23T13:55:01.543123456Z
255-
;
256-
257221
testMatchBooleanField
258222
required_capability: match_function
259223
required_capability: match_additional_types
@@ -311,25 +275,13 @@ required_capability: match_function
311275
required_capability: match_additional_types
312276

313277
from ul_logs
314-
| where bytes_out:"12749081495402663265"::UNSIGNED_LONG
278+
| where bytes_out:12749081495402663265
315279
| keep bytes_out;
316280

317281
bytes_out:unsigned_long
318282
12749081495402663265
319283
;
320284

321-
testMatchVersionField
322-
required_capability: match_function
323-
required_capability: match_additional_types
324-
325-
from apps
326-
| where version:"2.1"::VERSION
327-
| keep name, version;
328-
329-
name:keyword | version:version
330-
bbbbb | 2.1
331-
;
332-
333285
testMatchIpFieldAsString
334286
required_capability: match_function
335287
required_capability: match_additional_types

x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ regexBooleanExpression
7878
;
7979

8080
matchBooleanExpression
81-
: fieldExp=qualifiedName (CAST_OP fieldType=dataType)? COLON matchQuery=constant (CAST_OP queryType=dataType)?
81+
: fieldExp=qualifiedName (CAST_OP fieldType=dataType)? COLON matchQuery=constant
8282
;
8383

8484
valueExpression

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)