-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
Describe the bug
-- create table
DROP TABLE IF EXISTS `test_t`;
CREATE TABLE `test_t` (
`name` VARCHAR(1000) NULL COMMENT "string"
) ENGINE=OLAP
DUPLICATE KEY(`name`)
DISTRIBUTED BY HASH(`name`) BUCKETS 5
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "DEFAULT"
);
-- insert data
INSERT INTO test_t (`name`)
VALUES ('aaaaa'), ('ccccc')
;
-- returns wrong empty set
SELECT `t1`.`name`
FROM (
SELECT `name`
FROM `test_t`
GROUP BY `name`
) `t1`
UNION ALL
SELECT `t2`.`name`
FROM (
SELECT `name`,
-1 as `bool`
FROM `test_t`
GROUP BY `name`
) `t2`
WHERE `t2`.`bool` = 1
;
-- returns correct result ‘aaaaa’ and ‘ccccc’
SELECT `t2`.`name`
FROM (
SELECT `name`,
-1 as `bool`
FROM `test_t`
GROUP BY `name`
) `t2`
WHERE `t2`.`bool` = 1
UNION ALL
SELECT `t1`.`name`
FROM (
SELECT `name`
FROM `test_t`
GROUP BY `name`
) `t1`
;Additional context
Fixing, may need some help QAQ.
ppyaxinppyaxinppyaxinppyaxinppyaxinppyaxin
Metadata
Metadata
Assignees
Labels
No labels