You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2021/04/02 01:58:56 UTC

[GitHub] [zeppelin] zjffdu opened a new pull request #4083: [ZEPPELIN-5307] Ignore the single quote and double quote in sql comment

zjffdu opened a new pull request #4083:
URL: https://github.com/apache/zeppelin/pull/4083


   ### What is this PR for?
   
   This PR is to fix the bug of SqlSplitter when single/double quote in sql comment. UT is added. 
   
   ### What type of PR is it?
   [Bug Fix]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   * https://issues.apache.org/jira/browse/ZEPPELIN-5307
   
   ### How should this be tested?
   * CI pass
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] cuspymd commented on a change in pull request #4083: [ZEPPELIN-5307] Ignore the single quote and double quote in sql comment

Posted by GitBox <gi...@apache.org>.
cuspymd commented on a change in pull request #4083:
URL: https://github.com/apache/zeppelin/pull/4083#discussion_r606124319



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/util/SqlSplitter.java
##########
@@ -102,15 +102,15 @@ public SqlSplitter(String... additionalSingleCommentPrefixList) {
         multiLineComment = false;
       }
 
-      if (character == '\'') {
+      if (character == '\'' && (!singleLineComment && !multiLineComment)) {

Review comment:
       As shown below, moving "!" out of parentheses will make it easier to understand the conditions.
   ```
   if (character == '\'' && !(singleLineComment || multiLineComment)) {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] asfgit closed pull request #4083: [ZEPPELIN-5307] Ignore the single quote and double quote in sql comment

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #4083:
URL: https://github.com/apache/zeppelin/pull/4083


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] zjffdu commented on pull request #4083: [ZEPPELIN-5307] Ignore the single quote and double quote in sql comment

Posted by GitBox <gi...@apache.org>.
zjffdu commented on pull request #4083:
URL: https://github.com/apache/zeppelin/pull/4083#issuecomment-813027604


   Thanks for the review @cuspymd Will merge if no more comment


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] zjffdu commented on a change in pull request #4083: [ZEPPELIN-5307] Ignore the single quote and double quote in sql comment

Posted by GitBox <gi...@apache.org>.
zjffdu commented on a change in pull request #4083:
URL: https://github.com/apache/zeppelin/pull/4083#discussion_r606133784



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/util/SqlSplitter.java
##########
@@ -102,15 +102,15 @@ public SqlSplitter(String... additionalSingleCommentPrefixList) {
         multiLineComment = false;
       }
 
-      if (character == '\'') {
+      if (character == '\'' && (!singleLineComment && !multiLineComment)) {

Review comment:
       Addressed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org