Describe the bug
There is a table
CREATE TABLE `colo` (
`k1` tinyint(4) NULL COMMENT "",
`k2` smallint(6) NULL COMMENT "",
`k3` int(11) NULL COMMENT "",
`k4` bigint(20) SUM NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(`k1`, `k2`, `k3`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`k1`, `k2`, `k3`) BUCKETS 5
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "DEFAULT"
);
select b1.k1 from colo b1, colo b2 where b1.k1 = b2.k2 and b1.k2 = b2.k1 and b2.k3 = b1.k3;
should not be colocate join, because the eqjoinConjuncts column do not have the same order like colocate distribute column.
The corret SQL should be
select b1.k1 from colo b1, colo b2 where b1.k2 = b2.k2 and b1.k1 = b2.k1 and b2.k3 = b1.k3;