apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.7k stars 3.28k forks source link

[Bug] Can not hit rollup when using subquery. #6640

Open morningman opened 3 years ago

morningman commented 3 years ago

Search before asking

Version

Palo 0.14.13

What's Wrong?

select equipment_number,package_date, max(package_time) package_time from c_original_data_t group by equi
pment_number,package_date

can hit rollup, but the following sql can't:

explain select count(package_date) from (select equipment_number,package_date, max(package_time) package_time from c_original_data_t group by equi
pment_number,package_date) a group by package_date;

What You Expected?

the 2 sql can both hit rollup.

How to Reproduce?

No response

Anything Else?

CREATE TABLE c_original_data_t
(
    `package_time` bigint ,
    `package_date` int ,
    `equipment_number` VARCHAR(64) ,
    `receive_time` bigint ,
    `ip` VARCHAR(128) DEFAULT '',
    `data` VARCHAR(10000) DEFAULT ''
)
ENGINE=olap
DUPLICATE KEY(package_time, package_date,equipment_number,receive_time)
DISTRIBUTED BY HASH(`equipment_number`) BUCKETS 32
PROPERTIES(
    "replication_num" = "2"
);

create materialized view mv_c_original_data_t1 as select equipment_number,package_date, max(package_time) from c_original_data_t group by equipment_number,package_date;

Are you willing to submit PR?

Code of Conduct

SinyoWong commented 2 years ago

same problem!

SinyoWong commented 2 years ago

@morningman @yiguolei