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/20 02:16:41 UTC

[GitHub] [incubator-doris] yangzhg opened a new issue #3153: [Proposal] support for subquery in case when expr of select list

yangzhg opened a new issue #3153: [Proposal] support for subquery in case when expr of select list 
URL: https://github.com/apache/incubator-doris/issues/3153
 
 
   when query like:
   ```
   SELECT CASE
           WHEN (
               SELECT COUNT(*) / 2
               FROM t
           ) > k4 THEN (
               SELECT AVG(k4)
               FROM t
           )
           ELSE (
               SELECT SUM(k4)
               FROM t
           )
       END AS kk4
   FROM t;
   ```
   for now  doris is not support and this is used in tpcds
   this query canbe rewrite to 
   ```
   WITH t1 AS (
           SELECT COUNT(*) / 2 AS a
           FROM t
       ),
       t2 AS (
           SELECT AVG(k4) AS a
           FROM t
       ),
       t3 AS (
           SELECT SUM(k4) AS a
           FROM t
       )
   SELECT CASE
           WHEN t1.a > k4 THEN t2.a
           ELSE t3.a
       END AS kk4
   FROM t, t1, t2, t3;
   ```
   

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


[GitHub] [incubator-doris] imay closed issue #3153: [Proposal] support for subquery in case when expr of select list

Posted by GitBox <gi...@apache.org>.
imay closed issue #3153: [Proposal] support for subquery in case when expr of select list 
URL: https://github.com/apache/incubator-doris/issues/3153
 
 
   

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