Skip to content

Commit

Permalink
Added a nestedIdent in the parser
Browse files Browse the repository at this point in the history
Signed-off-by: Guian Gumpac <[email protected]>
  • Loading branch information
GumpacG committed Feb 9, 2023
1 parent f287cb2 commit 6ef8169
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void nested_function_in_select_test() {
verifySchema(result,
schema("nested(message.info)", null, "keyword"),
schema("nested(comment.data)", null, "keyword"),
schema("nested(comment.data)", null, "long"));
schema("nested(message.dayOfWeek)", null, "long"));
verifyDataRows(result,
rows("a", "ab", 1),
rows("b", "aa", 2),
Expand Down
10 changes: 9 additions & 1 deletion sql/src/main/antlr/OpenSearchSQLParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ nestedFunction
;

nestedField
: ident DOT ident (DOT ident)*
: nestedIdent DOT nestedIdent (DOT nestedIdent)*
;

highlightFunction
Expand Down Expand Up @@ -624,6 +624,14 @@ ident
| scalarFunctionName
;


nestedIdent
: ID
| BACKTICK_QUOTE_ID
| keywordsCanBeId
| scalarFunctionName
;

keywordsCanBeId
: FULL
| FIELD | D | T | TS // OD SQL and ODBC special
Expand Down

0 comments on commit 6ef8169

Please sign in to comment.