incubator-doris [Bug] Table join it's self should have same single partition to valid colocate join.

k5ifujac  于 2022-04-22  发布在  Java
关注(0)|答案(0)|浏览(118)

Describe the bug

CREATE TABLE `tbl1` (
  `k1` date NOT NULL COMMENT "",
  `k2` int(11) NOT NULL COMMENT "",
  `v1` int(11) SUM NOT NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(`k1`, `k2`)
COMMENT "OLAP"
PARTITION BY RANGE(`k1`)
(PARTITION p1 VALUES [('0000-01-01'), ('2019-05-31')),
PARTITION p2 VALUES [('2019-05-31'), ('2019-06-30')))
DISTRIBUTED BY HASH(`k2`) BUCKETS 8
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "DEFAULT"
);

There is a table tbl1 have 2 partition.

if we execute

select b1.k1 from tbl1 b1, tbl1 b2 where b1.k2 = b2.k2;

because there are two different partition, it should not be colocate join.

if we execute

select b1.k1 from tbl1 b1, tbl1 b2 where b1.k2 = b2.k2 and b1.k1 = '2019-05-23' and b2.k1 = b1.k1;

there is only one partition, it can be colocate join.

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题