-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] fix cte output column duplicate (#34904)
Signed-off-by: Seaven <seaven_7@qq.com>
- Loading branch information
Showing
3 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- name: test_same_correlation_col_in | ||
CREATE TABLE `t0` ( | ||
`v1` bigint(20) NULL COMMENT "", | ||
`v2` bigint(20) NULL COMMENT "", | ||
`v3` bigint(20) NULL COMMENT "", | ||
`v4` largeint NULL COMMENT "", | ||
`v5` tinyint NULL COMMENT "" | ||
) ENGINE=OLAP | ||
DUPLICATE KEY(`v1`) | ||
COMMENT "OLAP" | ||
DISTRIBUTED BY HASH(`v1`) BUCKETS 3 | ||
PROPERTIES ( | ||
"replication_num" = "1", | ||
"in_memory" = "false", | ||
"enable_persistent_index" = "false", | ||
"replicated_storage" = "false", | ||
"compression" = "LZ4" | ||
); | ||
-- result: | ||
-- !result | ||
insert into t0 values (1, 1, 1, null, null), (2, 2, 2, null, null); | ||
-- result: | ||
-- !result | ||
select * from t0 | ||
where (t0.v2 = 2) or t0.v3 in (select x0.v3 from t0 x0 where t0.v2 = x0.v3); | ||
-- result: | ||
2 2 2 None None | ||
1 1 1 None None | ||
-- !result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- name: test_same_correlation_col_in | ||
CREATE TABLE `t0` ( | ||
`v1` bigint(20) NULL COMMENT "", | ||
`v2` bigint(20) NULL COMMENT "", | ||
`v3` bigint(20) NULL COMMENT "", | ||
`v4` largeint NULL COMMENT "", | ||
`v5` tinyint NULL COMMENT "" | ||
) ENGINE=OLAP | ||
DUPLICATE KEY(`v1`) | ||
COMMENT "OLAP" | ||
DISTRIBUTED BY HASH(`v1`) BUCKETS 3 | ||
PROPERTIES ( | ||
"replication_num" = "1", | ||
"in_memory" = "false", | ||
"enable_persistent_index" = "false", | ||
"replicated_storage" = "false", | ||
"compression" = "LZ4" | ||
); | ||
|
||
insert into t0 values (1, 1, 1, null, null), (2, 2, 2, null, null); | ||
|
||
|
||
select * from t0 | ||
where (t0.v2 = 2) or t0.v3 in (select x0.v3 from t0 x0 where t0.v2 = x0.v3); |