blackfox1983 opened a new issue #4598:
URL: https://github.com/apache/incubator-doris/issues/4598


   **Describe the bug**
   In our system, the generated SQL will automatically use the form like 
```db.table``` , but in CTE it do NOT works.
   On the other hand, create table/view support grammar like db.table or 
db.view.
   We hope that CTE can also support this feature
   
   The case is shown as below
   ```
   MySQL [(none)]> with tmp as (select dt, app, chan, count(distinct uids) as 
uv FROM db.mytale WHERE dt = 20200913 group by dt, app, chan)
       -> select dt,app, 
       -> sum(uv) as uv, 
       -> sum(distinct case when chan= 1 then uv else 0 end) as new_uv
       -> from tmp
       -> group by dt, app;
   ERROR 1046 (3D000): errCode = 2, detailMessage = No database selected
   MySQL [(none)]> 
   ```
   
   Also, SQL statements like ```with db.tmp (....) ``` cannot be run
   
   **To Reproduce**
   
   **Expected behavior**
   support statement like 
   ```
   with database.tmp (xxx)
   select f1 from database.tmp ...
   ```
   
   **Additional context**
   Add any other context about the problem here.
   


----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to