@Test public void testMultipleStatement() throws Exception { String sql = "SET flink.enable.checkpoint=1;"; SqlNodeList list = Planner.parse(sql); assertEquals(1, list.size()); sql = "SET flink.enable.checkpoint=1;\n" + "SELECT * FROM foo"; list = Planner.parse(sql); assertEquals(2, list.size()); sql = "SET flink.enable.checkpoint=1;\n" + "SELECT * FROM foo;"; list = Planner.parse(sql); assertEquals(2, list.size()); }
@VisibleForTesting static SqlNodeList parse(String sql) throws ParseException { try (StringReader in = new StringReader(sql)) { SqlParserImpl impl = new SqlParserImpl(in); impl.switchTo("BTID"); impl.setTabSize(1); impl.setQuotedCasing(Lex.JAVA.quotedCasing); impl.setUnquotedCasing(Lex.JAVA.unquotedCasing); impl.setIdentifierMaxLength(DEFAULT_IDENTIFIER_MAX_LENGTH); return impl.SqlStmtsEof(); } }
Planner { @VisibleForTesting static SqlNodeList parse(String sql) throws ParseException { try (StringReader in = new StringReader(sql)) { SqlParserImpl impl = new SqlParserImpl(in); impl.switchTo("BTID"); impl.setTabSize(1); impl.setQuotedCasing(Lex.JAVA.quotedCasing); impl.setUnquotedCasing(Lex.JAVA.unquotedCasing); impl.setIdentifierMaxLength(DEFAULT_IDENTIFIER_MAX_LENGTH); return impl.SqlStmtsEof(); } } }
Planner { @VisibleForTesting static SqlNodeList parse(String sql) throws ParseException { try (StringReader in = new StringReader(sql)) { SqlParserImpl impl = new SqlParserImpl(in); impl.switchTo("BTID"); impl.setTabSize(1); impl.setQuotedCasing(Lex.JAVA.quotedCasing); impl.setUnquotedCasing(Lex.JAVA.unquotedCasing); impl.setIdentifierMaxLength(DEFAULT_IDENTIFIER_MAX_LENGTH); return impl.SqlStmtsEof(); } } Planner(Map<String, AthenaXTableCatalog> inputs, AthenaXTableCatalog outputs); }
Planner { @VisibleForTesting static SqlNodeList parse(String sql) throws ParseException { try (StringReader in = new StringReader(sql)) { SqlParserImpl impl = new SqlParserImpl(in); impl.switchTo("BTID"); impl.setTabSize(1); impl.setQuotedCasing(Lex.JAVA.quotedCasing); impl.setUnquotedCasing(Lex.JAVA.unquotedCasing); impl.setIdentifierMaxLength(DEFAULT_IDENTIFIER_MAX_LENGTH); return impl.SqlStmtsEof(); } } Planner(Map<String, AthenaXTableCatalog> inputs, AthenaXTableCatalog outputs); JobCompilationResult sql(String sql, int parallelism); }
Planner { @VisibleForTesting static SqlNodeList parse(String sql) throws ParseException { try (StringReader in = new StringReader(sql)) { SqlParserImpl impl = new SqlParserImpl(in); impl.switchTo("BTID"); impl.setTabSize(1); impl.setQuotedCasing(Lex.JAVA.quotedCasing); impl.setUnquotedCasing(Lex.JAVA.unquotedCasing); impl.setIdentifierMaxLength(DEFAULT_IDENTIFIER_MAX_LENGTH); return impl.SqlStmtsEof(); } } Planner(Map<String, AthenaXTableCatalog> inputs, AthenaXTableCatalog outputs); JobCompilationResult sql(String sql, int parallelism);  }