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 2021/01/25 09:39:24 UTC

[GitHub] [incubator-doris] jollykingCN opened a new issue #5296: [BUG] [materialized view] If the sql can hit the materialized view, then the FE will throw Exception: errCode = 2, detailMessage = Unknown column 'mv_count_columnname' ....

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


   **Describe the bug**
   If the sql can hit the materialized view, the query will be failed and in the fe.warn.log has Exception that 'Unknown column'  
   (sql查询一旦命中物化视图, FE就会报出Unknown column的异常而查询失败.)
   
   **To Reproduce**
   1. create db and table: t_event. its columns were: event_time_dayinweek / event_define_id / event_id / ... and so on.
   2. create materialized view
   ```sql
   create materialized view mv_dayinweek_count as 
   select 
     a.`event_time_dayinweek`, 
     a.`event_define_id`, 
     count(event_id)
   from t_event a 
   group by a.`event_time_dayinweek`, a.`event_define_id`;
   ```
   3. my query sql is:
   ```sql
   select 
     a.`event_time_dayinweek`, 
     event_define_id, 
     count(event_id)
   from t_event a 
   group by a.`event_time_dayinweek`,a.`event_define_id` 
   order by a.event_time_dayinweek, count(event_id);
   ```
   4. the query will be failed and in the fe.warn.log has Exception: 
   ``` 
   [StmtExecutor.analyze():507] Analyze failed because
   java.lang.IllegalStateException: org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unknown column 'mv_count_event_id' in 'default_cluster:smg_user_new_65.t_event'
   	at org.apache.doris.analysis.Expr.analyzeNoThrow(Expr.java:535) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.rewrite.mvrewrite.CountFieldToSum.rewriteExpr(CountFieldToSum.java:95) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.rewrite.mvrewrite.CountFieldToSum.apply(CountFieldToSum.java:83) ~[palo-fe.jar:3.4.0]
   ```
   
   **Doris Server Information**
    - Version: Baidu Doris(Palo) version 0.13.15-4e19c23
   


----------------------------------------------------------------
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 #5296: [BUG] [materialized view] If the sql can hit the materialized view, then the FE will throw Exception: errCode = 2, detailMessage = Unknown column 'mv_count_columnname' ....

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


   This bug may be caused by table alias, the following sql is OK:
   ```
   select 
     `event_time_dayinweek`, 
     event_define_id, 
     count(event_id)
   from t_event
   group by `event_time_dayinweek`,`event_define_id` 
   order by event_time_dayinweek, count(event_id);
   ```
   
   We will look deep into it.


----------------------------------------------------------------
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] jollykingCN commented on issue #5296: [BUG] [materialized view] If the sql can hit the materialized view, then the FE will throw Exception: errCode = 2, detailMessage = Unknown column 'mv_count_columnname' ....

Posted by GitBox <gi...@apache.org>.
jollykingCN commented on issue #5296:
URL: https://github.com/apache/incubator-doris/issues/5296#issuecomment-766728704


   > This bug may be caused by table alias, the following sql is OK:
   > 
   > ```
   > select 
   >   `event_time_dayinweek`, 
   >   event_define_id, 
   >   count(event_id)
   > from t_event
   > group by `event_time_dayinweek`,`event_define_id` 
   > order by event_time_dayinweek, count(event_id);
   > ```
   > 
   > We will look deep into it.
   
   yeah, after remove the alias, it work.  thanks :-)


----------------------------------------------------------------
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 #5296: [BUG] [materialized view] If the sql can hit the materialized view, then the FE will throw Exception: errCode = 2, detailMessage = Unknown column 'mv_count_columnname' ....

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


   This bug may be caused by table alias, the following sql is OK:
   ```
   select 
     `event_time_dayinweek`, 
     event_define_id, 
     count(event_id)
   from t_event
   group by `event_time_dayinweek`,`event_define_id` 
   order by event_time_dayinweek, count(event_id);
   ```
   
   We will look deep into it.


----------------------------------------------------------------
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] jollykingCN commented on issue #5296: [BUG] [materialized view] If the sql can hit the materialized view, then the FE will throw Exception: errCode = 2, detailMessage = Unknown column 'mv_count_columnname' ....

Posted by GitBox <gi...@apache.org>.
jollykingCN commented on issue #5296:
URL: https://github.com/apache/incubator-doris/issues/5296#issuecomment-766691055






----------------------------------------------------------------
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] jollykingCN commented on issue #5296: [BUG] [materialized view] If the sql can hit the materialized view, then the FE will throw Exception: errCode = 2, detailMessage = Unknown column 'mv_count_columnname' ....

Posted by GitBox <gi...@apache.org>.
jollykingCN commented on issue #5296:
URL: https://github.com/apache/incubator-doris/issues/5296#issuecomment-766691055


   the full exception stack:
   ```
   2021-01-25 16:31:15,607 WARN (doris-mysql-nio-pool-13|188) [StmtExecutor.analyze():507] Analyze failed because
   java.lang.IllegalStateException: org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unknown column 'mv_count_event_id' in 'default_cluster:smg_user_new_65.t_event'
   	at org.apache.doris.analysis.Expr.analyzeNoThrow(Expr.java:535) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.rewrite.mvrewrite.CountFieldToSum.rewriteExpr(CountFieldToSum.java:95) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.rewrite.mvrewrite.CountFieldToSum.apply(CountFieldToSum.java:83) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.rewrite.ExprRewriter.applyRuleBottomUp(ExprRewriter.java:110) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.rewrite.ExprRewriter.applyRuleRepeatedly(ExprRewriter.java:96) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.rewrite.ExprRewriter.rewrite(ExprRewriter.java:61) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.analysis.QueryStmt.rewriteQueryExprByMvColumnExpr(QueryStmt.java:255) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.analysis.SelectStmt.analyze(SelectStmt.java:392) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.StmtExecutor.analyzeAndGenerateQueryPlan(StmtExecutor.java:525) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:495) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:274) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:245) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:202) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:334) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:536) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50) ~[palo-fe.jar:3.4.0]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_251]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_251]
   	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251]
   Caused by: org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unknown column 'mv_count_event_id' in 'default_cluster:smg_user_new_65.t_event'
   	at org.apache.doris.common.ErrorReport.reportAnalysisException(ErrorReport.java:52) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.common.ErrorReport.reportAnalysisException(ErrorReport.java:47) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.analysis.Analyzer.registerColumnRef(Analyzer.java:598) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.analysis.SlotRef.analyzeImpl(SlotRef.java:139) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.analysis.Expr.analyze(Expr.java:380) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.analysis.Expr.analyze(Expr.java:374) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.analysis.Expr.analyzeNoThrow(Expr.java:533) ~[palo-fe.jar:3.4.0]
   	... 18 more
   2021-01-25 16:31:15,608 WARN (doris-mysql-nio-pool-13|188) [StmtExecutor.execute():360] execute Exception. {}
   org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unexpected exception: org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unknown column 'mv_count_event_id' in 'default_cluster:smg_user_new_65.t_event'
   	at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:508) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:274) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:245) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:202) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:334) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:536) ~[palo-fe.jar:3.4.0]
   	at org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50) ~[palo-fe.jar:3.4.0]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_251]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_251]
   	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251]
   ```


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