Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unknown column when use MV and table alias #13605

Closed
3 tasks done
morrySnow opened this issue Oct 24, 2022 · 0 comments · Fixed by #13597
Closed
3 tasks done

[Bug] Unknown column when use MV and table alias #13605

morrySnow opened this issue Oct 24, 2022 · 0 comments · Fixed by #13597

Comments

@morrySnow
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Version

all

What's Wrong?

throw exception

 Unexpected exception: org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unknown column 'mv_bitmap_union_mh' in 'default_cluster:test.original_table'

What You Expected?

query success

How to Reproduce?

CREATE TABLE test.original_table
(
day date,
aid bigint,
lid bigint,
yid bigint,
mh bigint,
my bigint
)
DUPLICATE KEY(`day`, `aid`, `lid`)
DISTRIBUTED BY HASH(aid)
PROPERTIES ("replication_num" = "1" );

insert into test.original_table values('2022-10-16', 1665710553, 1665710553, 1665710553, 1665700553, 1665700553);

create materialized view mv_table as
select day,aid,lid,
       bitmap_union(to_bitmap(mh)) as wu,     
       bitmap_union(to_bitmap(my)) as mu 
from test.original_table 
group by day, aid, lid;

wait a while until mv create success. and then

select t0.aid, t0.lid, count(distinct mh), count(distinct my) 
from test.original_table t0 
where t0.day = '2022-10-16' and t0.lid > 0 group by t0.aid, t0.lid;

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant