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/10/13 00:42:34 UTC

[GitHub] [incubator-doris] Astralidea edited a comment on issue #4598: The database option is not supported with the CTE statement

Astralidea edited a comment on issue #4598:
URL: https://github.com/apache/incubator-doris/issues/4598#issuecomment-707416763


   > @Astralidea thanks for your pr. it run ok if the sql is simple. e.g. `with tmp as (..) select xx from tmp`
   > 
   > but i found a problem in my production-env if i run a sql with join/union, it will run failed as below
   > 
   > ```
   > MySQL [(none)]> with tmp as (SELECT dt, app, bitmap_union(cuids) as uids
   >     ->     FROM db.mytable
   >     ->     WHERE dt = 20200925
   >     ->         AND app IN ('xxx')
   >     ->     GROUP BY dt, app)
   >     -> 
   >     -> select a.dt, b.app , a.uv from 
   >     -> (select dt, count(distinct uids) as uv from tmp group by dt) a
   >     -> left join (select dt, app from tmp) b on a.dt = b.dt;
   > ERROR 1046 (3D000): errCode = 2, detailMessage = No database selected
   > ```
   > 
   > btw: Is the with syntax a simple macro replacement or a result set reuse at run time?
   
   I'll see why Doris can't do this case recently


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