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/03/17 14:46:25 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #3135: support subquery in case when statement

morningman commented on a change in pull request #3135: support subquery in case when statement
URL: https://github.com/apache/incubator-doris/pull/3135#discussion_r393727675
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/analysis/SelectStmt.java
 ##########
 @@ -1244,6 +1213,46 @@ public void rewriteExprs(ExprRewriter rewriter) throws AnalysisException {
                 orderByElem.setExpr(rewriter.rewrite(orderByElem.getExpr(), analyzer));
             }
         }
+        if (subqueryInCase) {
+            for (SelectListItem item : selectList.getItems()) {
+                if (!(item.getExpr() instanceof CaseExpr)) {
+                    continue;
+                }
+                if (!item.getExpr().contains(Predicates.instanceOf(Subquery.class))) {
+                    continue;
+                }
+                item.setExpr(rewriteSubquery(item.getExpr()));
+            }
+        }
+    }
+
+
+    private Expr rewriteSubquery(Expr expr) throws AnalysisException {
 
 Review comment:
   Add comments for this method.

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


With regards,
Apache Git Services

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