Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ options { tokenVocab = DorisLexer; }
}

multiStatements
: (statement SEMICOLON*)+ EOF
: statement (SEMICOLON+ statement)* SEMICOLON* EOF
;

singleStatement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,18 @@ public class NereidsParserTest extends ParserTestBase {
@Test
public void testParseMultiple() {
NereidsParser nereidsParser = new NereidsParser();
String sql = "SELECT b FROM test;SELECT a FROM test;";
String sql = "SELECT b FROM test;;;;SELECT a FROM test;";
List<Pair<LogicalPlan, StatementContext>> logicalPlanList = nereidsParser.parseMultiple(sql);
Assertions.assertEquals(2, logicalPlanList.size());
}

@Test
public void testParseMultipleError() {
NereidsParser nereidsParser = new NereidsParser();
String sql = "SELECT b FROM test SELECT a FROM test;";
Assertions.assertThrowsExactly(ParseException.class, () -> nereidsParser.parseMultiple(sql));
}

@Test
public void testSingle() {
NereidsParser nereidsParser = new NereidsParser();
Expand Down