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
- create db and table: t_event. its columns were: event_time_dayinweek / event_define_id / event_id / ... and so on.
- create materialized view
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`;
- my query sql is:
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);
- 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
3条答案
按热度按时间hc2pp10m1#
the full exception stack:
relj7zay2#
This bug may be caused by table alias, the following sql is OK:
We will look deep into it.
5q4ezhmt3#
This bug may be caused by table alias, the following sql is OK:
We will look deep into it.
yeah, after remove the alias, it work. thanks :-)