Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.8k
ZEPPELIN-3344. Revert comments in queries in JDBC interpreter#2876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -189,13 +189,16 @@ public void testSplitSqlQuery() throws SQLException, IOException { | ||
| "select '\n', ';';" + | ||
| "select replace('A\\;B', '\\', 'text');" + | ||
| "select '\\', ';';" + | ||
| "select '''', ';'"; | ||
| "select '''', ';';" + | ||
| "select /*+ scan */ * from test_table;" + | ||
| "--singleLineComment\nselect * from test_table"; | ||
| Properties properties = new Properties(); | ||
| JDBCInterpreter t = new JDBCInterpreter(properties); | ||
| t.open(); | ||
| List<String> multipleSqlArray = t.splitSqlQueries(sqlQuery); | ||
| assertEquals(8, multipleSqlArray.size()); | ||
| assertEquals(10, multipleSqlArray.size()); | ||
| assertEquals("insert into test_table(id, name) values ('a', ';\"')", multipleSqlArray.get(0)); | ||
| assertEquals("select * from test_table", multipleSqlArray.get(1)); | ||
| assertEquals("select * from test_table WHERE ID = \";'\"", multipleSqlArray.get(2)); | ||
| @@ -204,6 +207,8 @@ public void testSplitSqlQuery() throws SQLException, IOException { | ||
| assertEquals("select replace('A\\;B', '\\', 'text')", multipleSqlArray.get(5)); | ||
| assertEquals("select '\\', ';'", multipleSqlArray.get(6)); | ||
| assertEquals("select '''', ';'", multipleSqlArray.get(7)); | ||
| assertEquals("select /*+ scan */ * from test_table", multipleSqlArray.get(8)); | ||
| assertEquals("--singleLineComment\nselect * from test_table", multipleSqlArray.get(9)); | ||
| } | ||
| @Test | ||
| @@ -534,7 +539,7 @@ public void testPrecodeWithAnotherPrefix() throws SQLException, IOException { | ||
| } | ||
| @Test | ||
| public void testExcludingComments() throws SQLException, IOException { | ||
| public void testSplitSqlQueryWithComments() throws SQLException, IOException { | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No test case needs to add or change ? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zjffdu done. | ||
| Properties properties = new Properties(); | ||
| properties.setProperty("common.max_count", "1000"); | ||
| properties.setProperty("common.max_retry", "3"); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zjffdu The last two lines are new tests for processing of the comments.