Skip to content

Commit

Permalink
sqllogicaltest: use rowsort. (#5189)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener authored Feb 6, 2023
1 parent 6eb0e36 commit a67ef91
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
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;

0 comments on commit a67ef91

Please sign in to comment.