You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2018/10/22 19:15:43 UTC
[GitHub] shaofengshi commented on a change in pull request #302: KYLIN-3620 resolve "--" is treated as comment marker between singe qu…
shaofengshi commented on a change in pull request #302: KYLIN-3620 resolve "--" is treated as comment marker between singe qu…
URL: https://github.com/apache/kylin/pull/302#discussion_r227016749
##########
File path: query/src/main/java/org/apache/kylin/query/util/QueryUtil.java
##########
@@ -184,7 +184,7 @@ public static boolean isSelectStatement(String sql) {
public static String removeCommentInSql(String sql1) {
// match two patterns, one is "-- comment", the other is "/* comment */"
- final String[] commentPatterns = new String[] { "--[^\r\n]*", "/\\*[\\s\\S]*?\\*/" };
+ final String[] commentPatterns = new String[]{"--(?!.*\\*/).*?[\r\n]", "/\\*(.|\r|\n)*?\\*/"};
Review comment:
Is the code formatted?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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
With regards,
Apache Git Services