Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqllogicaltest: add cleanup and use rowsort. #5189

Merged
merged 1 commit into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ STORED AS CSV
WITH HEADER ROW
LOCATION '../../testing/data/csv/aggregate_test_100.csv'

query I
query I rowsort
SELECT * FROM (
SELECT c2
FROM aggregate_test_100_by_sql t1
Expand All @@ -76,13 +76,12 @@ SELECT * FROM (
FROM aggregate_test_100_by_sql t2
WHERE c2 IN (3, 4)
) s
ORDER BY c2
----
1
2
5

query I
query I rowsort
SELECT * FROM (
SELECT c2
FROM aggregate_test_100_by_sql t1
Expand All @@ -91,7 +90,6 @@ SELECT * FROM (
FROM aggregate_test_100_by_sql t2
WHERE c2 IN (3, 4)
) s
ORDER BY c2
----
1
1
Expand Down Expand Up @@ -153,7 +151,7 @@ ORDER BY c2
5


query I
query I rowsort
SELECT * FROM (
SELECT c2
FROM aggregate_test_100_by_sql t1
Expand All @@ -162,13 +160,12 @@ SELECT * FROM (
FROM aggregate_test_100_by_sql t2
WHERE c2 IN (3, 4)
) s
ORDER BY c2
----
3
4


query I
query I rowsort
SELECT * FROM (
SELECT c2
FROM aggregate_test_100_by_sql t1
Expand All @@ -177,7 +174,6 @@ SELECT * FROM (
FROM aggregate_test_100_by_sql t2
WHERE c2 IN (3, 4)
) s
ORDER BY c2
----
3
3
Expand Down
39 changes: 23 additions & 16 deletions datafusion/core/tests/sqllogictests/test_files/union.slt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CREATE TABLE t2(
;

# union with EXCEPT(JOIN)
query T
query T rowsort
(
SELECT name FROM t1
EXCEPT
Expand All @@ -52,13 +52,12 @@ UNION ALL
EXCEPT
SELECT name FROM t1
)
ORDER BY name
----
Alice
John

# union with type coercion
query T
query T rowsort
(
SELECT * FROM t1
EXCEPT
Expand All @@ -70,17 +69,15 @@ UNION ALL
EXCEPT
SELECT * FROM t1
)
ORDER BY name
----
3 Alice
3 John

# union all
query I
query I rowsort
SELECT 1 as x
UNION ALL
SELECT 2 as x
ORDER BY x
----
1
2
Expand Down Expand Up @@ -116,11 +113,10 @@ select COUNT(*) from (
200

# union_distinct
query I
query I rowsort
SELECT 1 as x
UNION
SELECT 1 as x
ORDER BY x
----
1

Expand Down Expand Up @@ -148,21 +144,21 @@ SELECT COUNT(*) FROM (
2

# union_schemas
query I
SELECT 1 A UNION ALL SELECT 2 ORDER BY 1
query I rowsort
SELECT 1 A UNION ALL SELECT 2
----
1
2

# union_schemas
query I
SELECT 1 UNION SELECT 2 ORDER BY 1
query I rowsort
SELECT 1 UNION SELECT 2
----
1
2

# union_with_except_input
query T
query T rowsort
(
SELECT name FROM t1
EXCEPT
Expand All @@ -174,13 +170,12 @@ UNION ALL
EXCEPT
SELECT name FROM t1
)
ORDER BY name
----
Alice
John

# union_with_type_coercion
query IT
query IT rowsort
(
SELECT id, name FROM t1
EXCEPT
Expand All @@ -192,7 +187,19 @@ UNION ALL
EXCEPT
SELECT id, name FROM t1
)
ORDER BY name
----
3 Alice
3 John

########
# Clean up after the test
########

statement ok
drop table t1;

statement ok
drop table t2;

statement ok
drop table aggregate_test_100;