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/20 10:32:09 UTC

[GitHub] [incubator-doris] yangzhg opened a new pull request #3357: disable some unsupported syntax

yangzhg opened a new pull request #3357:
URL: https://github.com/apache/incubator-doris/pull/3357


   disable some syntax when subquery is not in binary predicate in case when clause


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


[GitHub] [incubator-doris] morningman commented on issue #3357: disable some unsupported syntax

Posted by GitBox <gi...@apache.org>.
morningman commented on issue #3357:
URL: https://github.com/apache/incubator-doris/pull/3357#issuecomment-616619023


   Hi @yangzhg , you need to create an issue to describe your problem, better to give an example about the query you try to disable.


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


[GitHub] [incubator-doris] morningman commented on a change in pull request #3357: disable some unsupported syntax

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #3357:
URL: https://github.com/apache/incubator-doris/pull/3357#discussion_r413035997



##########
File path: fe/src/main/java/org/apache/doris/analysis/SelectStmt.java
##########
@@ -1362,9 +1362,24 @@ private void rewriteSelectList(ExprRewriter rewriter) throws AnalysisException {
             if (!item.getExpr().contains(Predicates.instanceOf(Subquery.class))) {
                 continue;
             }
+            CaseExpr caseExpr = (CaseExpr) item.getExpr();
+
+            int childIdx = 0;
+            if (caseExpr.hasCaseExpr()
+                    && caseExpr.getChild(childIdx++).contains(Predicates.instanceOf(Subquery.class))) {
+                throw new AnalysisException("Only support subquery in binary predicate in case statement.");
+            }
+            while (childIdx + 2 <= caseExpr.getChildren().size()) {
+                Expr child = caseExpr.getChild(childIdx++);
+                // case

Review comment:
       `caseExpr.getChild(childIdx++)` here you got the `when` expr

##########
File path: fe/src/main/java/org/apache/doris/analysis/SelectStmt.java
##########
@@ -1362,9 +1362,24 @@ private void rewriteSelectList(ExprRewriter rewriter) throws AnalysisException {
             if (!item.getExpr().contains(Predicates.instanceOf(Subquery.class))) {
                 continue;
             }
+            CaseExpr caseExpr = (CaseExpr) item.getExpr();
+
+            int childIdx = 0;
+            if (caseExpr.hasCaseExpr()
+                    && caseExpr.getChild(childIdx++).contains(Predicates.instanceOf(Subquery.class))) {
+                throw new AnalysisException("Only support subquery in binary predicate in case statement.");
+            }
+            while (childIdx + 2 <= caseExpr.getChildren().size()) {
+                Expr child = caseExpr.getChild(childIdx++);
+                // case
+                if (!(child instanceof BinaryPredicate) && child.contains(Predicates.instanceOf(Subquery.class))) {
+                    throw new AnalysisException("Only support subquery in binary predicate in case statement.");
+                }
+                // when

Review comment:
       Here is to skip `then` expr, not `when`




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


[GitHub] [incubator-doris] yangzhg commented on issue #3357: disable some unsupported syntax

Posted by GitBox <gi...@apache.org>.
yangzhg commented on issue #3357:
URL: https://github.com/apache/incubator-doris/pull/3357#issuecomment-617528932


   > Hi @yangzhg , you need to create an issue to describe your problem, better to give an example about the query you try to disable.
   
   done


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


[GitHub] [incubator-doris] kangkaisen commented on issue #3357: disable some unsupported syntax

Posted by GitBox <gi...@apache.org>.
kangkaisen commented on issue #3357:
URL: https://github.com/apache/incubator-doris/pull/3357#issuecomment-617841075


   @yangzhg Please add a UT


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