should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,66 @@
# name: test/optimizer/union_exclude.test
# description: Test union and exclude
# group: [optimizer]
statement ok
CREATE TABLE test_df_a(number BIGINT, date VARCHAR, rn BIGINT);
statement ok
INSERT INTO test_df_a VALUES(7058,'2015-07-31',1);
statement ok
INSERT INTO test_df_a VALUES(7058,'2015-07-31',2);
statement ok
INSERT INTO test_df_a VALUES(7075,'2016-07-31',1);
statement ok
INSERT INTO test_df_a VALUES(7076,'2017-07-31',1);
statement ok
INSERT INTO test_df_a VALUES(7076,'2017-07-31',2);
statement ok
CREATE TABLE test_df_b(number BIGINT, date VARCHAR, rn BIGINT);;
statement ok
INSERT INTO test_df_b VALUES(7058,'2015-07-31',1);
statement ok
INSERT INTO test_df_b VALUES(7058,'2015-07-31',2);
statement ok
INSERT INTO test_df_b VALUES(7012,'2015-07-31',1);
statement ok
INSERT INTO test_df_b VALUES(7075,'2016-07-31',1);
statement ok
INSERT INTO test_df_b VALUES(7076,'2017-07-31',1);
query II
with t as (select * from test_df_a UNION select * from test_df_b) select * exclude rn from t order by all;
----
7012 2015-07-31
7058 2015-07-31
7058 2015-07-31
7075 2016-07-31
7076 2017-07-31
7076 2017-07-31
statement ok
create table t1 as select 1 a, range b from range(100);
statement ok
create table t2 as select 1 a, range b from range(100);
query I
select count(a) from (select * from t1 union select * from t2) t_union;
----
100
query I
select count(a) from (select * from t1 union all select * from t2) t_union;
----
200