incubator-doris [Bug] Can not hit rollup when using subquery.

j2cgzkjk  于 2022-04-22  发布在  Java
关注(0)|答案(2)|浏览(232)

Search before asking

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

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?

  • Yes I am willing to submit a PR!

Code of Conduct

相关问题