Skip to content

Commit

Permalink
Change grammar and add UT
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Dai <[email protected]>
  • Loading branch information
dai-chen committed Jun 30, 2021
1 parent 47f5534 commit b23c4a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sql/src/main/antlr/OpenSearchSQLParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ adminStatement
;

showStatement
: SHOW TABLES tableFilter?
: SHOW TABLES tableFilter
;

describeStatement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,9 @@ public void canParseOrderByClause() {
"SELECT name, age FROM test ORDER BY name ASC NULLS FIRST, age DESC NULLS LAST"));
}

@Test
public void canNotParseShowStatementWithoutFilterClause() {
assertThrows(SyntaxCheckException.class, () -> parser.parse("SHOW TABLES"));
}

}

0 comments on commit b23c4a5

Please sign in to comment.