You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/04/22 14:05:59 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #3378: Forbidden correlated having clause

morningman commented on a change in pull request #3378:
URL: https://github.com/apache/incubator-doris/pull/3378#discussion_r413008206



##########
File path: fe/src/main/java/org/apache/doris/analysis/BaseViewStmt.java
##########
@@ -109,33 +112,37 @@ protected void createColumnAndViewDefs(Analyzer analyzer) throws AnalysisExcepti
         }
 
         // format view def string
-        originalViewDef = viewDefStmt.toSql();
+        String lowerCaseOriginSql = getOriginSql().toLowerCase();

Review comment:
       I think you can not just call `toLowerCase()`, what if the statement is
   ```
   select * from tbl where k1 like "%ABC%";
   ```
   
   And why not just save the entire origin statement with `CREATE VIEW AS` inside it? And you can just get the `QueryStmt` part when parsing it again.

##########
File path: fe/src/main/java/org/apache/doris/qe/ConnectProcessor.java
##########
@@ -225,7 +226,13 @@ private void handleQuery() {
         SqlScanner input = new SqlScanner(new StringReader(originStmt), ctx.getSessionVariable().getSqlMode());
         SqlParser parser = new SqlParser(input);
         try {
-            return SqlParserUtils.getMultiStmts(parser);
+            List<StatementBase> result = SqlParserUtils.getMultiStmts(parser);
+            String[] originStmtList = originStmt.split(";");

Review comment:
       There maybe `;` inside the query statement




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org