Skip to content

Commit 4954cab

Browse files
authored
Fix missing keywordsCanBeId (#4491)
* Fix missing keywordsCanBeId Signed-off-by: Lantao Jin <ltjin@amazon.com> * revert partially Signed-off-by: Lantao Jin <ltjin@amazon.com> --------- Signed-off-by: Lantao Jin <ltjin@amazon.com>
1 parent 5c784fe commit 4954cab

3 files changed

Lines changed: 69 additions & 5 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
"Fix missing keywordsCanBeID":
2+
- skip:
3+
features:
4+
- headers
5+
- allowed_warnings
6+
- do:
7+
indices.create:
8+
index: log-test
9+
body:
10+
mappings:
11+
properties:
12+
"as":
13+
properties:
14+
"field":
15+
properties:
16+
"on":
17+
properties:
18+
"limit":
19+
properties:
20+
"datamodel":
21+
properties:
22+
"overwrite":
23+
properties:
24+
"sed":
25+
properties:
26+
"label":
27+
properties:
28+
"aggregation":
29+
properties:
30+
"brain":
31+
properties:
32+
"simple_pattern":
33+
properties:
34+
"max_match":
35+
properties:
36+
"offset_field":
37+
properties:
38+
"to":
39+
properties:
40+
"millisecond":
41+
type: integer
42+
43+
- do:
44+
bulk:
45+
index: log-test
46+
refresh: true
47+
body:
48+
- '{"index": {}}'
49+
- '{"as": {"field": {"on": {"limit": {"datamodel": {"overwrite": {"sed": {"label": {"aggregation": {"brain": {"simple_pattern": {"max_match": {"offset_field": {"to": {"millisecond": 1 } } } } } } } } } } } } } } }'
50+
51+
- do:
52+
headers:
53+
Content-Type: 'application/json'
54+
ppl:
55+
body:
56+
query: source=log-test | fields as.field.on.limit.datamodel.overwrite.sed.label.aggregation.brain.simple_pattern.max_match.offset_field.to.millisecond
57+
58+
- match: { total: 1 }
59+
- length: { datarows: 1 }

ppl/src/main/antlr/OpenSearchPPLLexer.g4

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ HOUR_OF_DAY: 'HOUR_OF_DAY';
170170
HOUR_SECOND: 'HOUR_SECOND';
171171
INTERVAL: 'INTERVAL';
172172
MICROSECOND: 'MICROSECOND';
173-
MILLISECOND: 'MILLISECOND';
174173
MINUTE: 'MINUTE';
175174
MINUTE_MICROSECOND: 'MINUTE_MICROSECOND';
176175
MINUTE_OF_DAY: 'MINUTE_OF_DAY';
@@ -188,9 +187,7 @@ YEAR: 'YEAR';
188187
YEAR_MONTH: 'YEAR_MONTH';
189188

190189
// DATASET TYPES
191-
DATAMODEL: 'DATAMODEL';
192190
LOOKUP: 'LOOKUP';
193-
SAVEDSEARCH: 'SAVEDSEARCH';
194191

195192
// CONVERTED DATA TYPES
196193
INT: 'INT';
@@ -398,7 +395,6 @@ SUBSTRING: 'SUBSTRING';
398395
LTRIM: 'LTRIM';
399396
RTRIM: 'RTRIM';
400397
TRIM: 'TRIM';
401-
TO: 'TO';
402398
LOWER: 'LOWER';
403399
UPPER: 'UPPER';
404400
CONCAT: 'CONCAT';

ppl/src/main/antlr/OpenSearchPPLParser.g4

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,16 @@ searchableKeyWord
14671467
| PATH
14681468
| INPUT
14691469
| OUTPUT
1470-
1470+
| AS
1471+
| ON
1472+
| LIMIT
1473+
| OVERWRITE
1474+
| FIELD
1475+
| SED
1476+
| MAX_MATCH
1477+
| OFFSET_FIELD
1478+
| patternMethod
1479+
| patternMode
14711480
// AGGREGATIONS AND WINDOW
14721481
| statsFunctionName
14731482
| windowFunctionName

0 commit comments

Comments
 (0)