-
Notifications
You must be signed in to change notification settings - Fork 176
Description
The Situation
This issue came up with #4185, #4113, #4120, and probably others:
In the PPL and SQL grammars, there's a keywordsCanBeId entry:
sql/ppl/src/main/antlr/OpenSearchPPLParser.g4
Line 1314 in ab02d56
keywordsCanBeId |
We've been adding a lot of new keywords to the Lexer, but haven't been adding them all to this entry. This means that you can't use those keywords as fields anymore without escaping. You get an error similar to this:
[field] is not a valid term at this part of the query: '...output=output inner.field' <-- HERE. Expecting tokens: ID
In the above case, the field
keyword was added in #4109 and caused test failures for #4185 after merge, because field
was used as a generic field name.
The Fix
We should audit the new keywords added as part of the 3.3 rush, and verify that all appropriate new keywords are also available as field names.
We could also consider finding a way to refactor such that we don't need to manually update this allowlist to begin with.