diff --git a/integ-test/src/yamlRestTest/resources/rest-api-spec/test/issues/4481.yml b/integ-test/src/yamlRestTest/resources/rest-api-spec/test/issues/4481.yml new file mode 100644 index 00000000000..5dceb720c3b --- /dev/null +++ b/integ-test/src/yamlRestTest/resources/rest-api-spec/test/issues/4481.yml @@ -0,0 +1,59 @@ +"Fix missing keywordsCanBeID": + - skip: + features: + - headers + - allowed_warnings + - do: + indices.create: + index: log-test + body: + mappings: + properties: + "as": + properties: + "field": + properties: + "on": + properties: + "limit": + properties: + "datamodel": + properties: + "overwrite": + properties: + "sed": + properties: + "label": + properties: + "aggregation": + properties: + "brain": + properties: + "simple_pattern": + properties: + "max_match": + properties: + "offset_field": + properties: + "to": + properties: + "millisecond": + type: integer + + - do: + bulk: + index: log-test + refresh: true + body: + - '{"index": {}}' + - '{"as": {"field": {"on": {"limit": {"datamodel": {"overwrite": {"sed": {"label": {"aggregation": {"brain": {"simple_pattern": {"max_match": {"offset_field": {"to": {"millisecond": 1 } } } } } } } } } } } } } } }' + + - do: + headers: + Content-Type: 'application/json' + ppl: + body: + query: source=log-test | fields as.field.on.limit.datamodel.overwrite.sed.label.aggregation.brain.simple_pattern.max_match.offset_field.to.millisecond + + - match: { total: 1 } + - length: { datarows: 1 } diff --git a/ppl/src/main/antlr/OpenSearchPPLLexer.g4 b/ppl/src/main/antlr/OpenSearchPPLLexer.g4 index 30ba0f7013d..ba1e4960bb2 100644 --- a/ppl/src/main/antlr/OpenSearchPPLLexer.g4 +++ b/ppl/src/main/antlr/OpenSearchPPLLexer.g4 @@ -170,7 +170,6 @@ HOUR_OF_DAY: 'HOUR_OF_DAY'; HOUR_SECOND: 'HOUR_SECOND'; INTERVAL: 'INTERVAL'; MICROSECOND: 'MICROSECOND'; -MILLISECOND: 'MILLISECOND'; MINUTE: 'MINUTE'; MINUTE_MICROSECOND: 'MINUTE_MICROSECOND'; MINUTE_OF_DAY: 'MINUTE_OF_DAY'; @@ -188,9 +187,7 @@ YEAR: 'YEAR'; YEAR_MONTH: 'YEAR_MONTH'; // DATASET TYPES -DATAMODEL: 'DATAMODEL'; LOOKUP: 'LOOKUP'; -SAVEDSEARCH: 'SAVEDSEARCH'; // CONVERTED DATA TYPES INT: 'INT'; @@ -398,7 +395,6 @@ SUBSTRING: 'SUBSTRING'; LTRIM: 'LTRIM'; RTRIM: 'RTRIM'; TRIM: 'TRIM'; -TO: 'TO'; LOWER: 'LOWER'; UPPER: 'UPPER'; CONCAT: 'CONCAT'; diff --git a/ppl/src/main/antlr/OpenSearchPPLParser.g4 b/ppl/src/main/antlr/OpenSearchPPLParser.g4 index 4cfa1288de7..2e03314c5f7 100644 --- a/ppl/src/main/antlr/OpenSearchPPLParser.g4 +++ b/ppl/src/main/antlr/OpenSearchPPLParser.g4 @@ -1467,7 +1467,16 @@ searchableKeyWord | PATH | INPUT | OUTPUT - + | AS + | ON + | LIMIT + | OVERWRITE + | FIELD + | SED + | MAX_MATCH + | OFFSET_FIELD + | patternMethod + | patternMode // AGGREGATIONS AND WINDOW | statsFunctionName | windowFunctionName