Skip to content
Merged
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
20 changes: 20 additions & 0 deletions datafusion/sqllogictest/test_files/select.slt
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,26 @@ statement error DataFusion error: Error during planning: EXCLUDE or EXCEPT conta
SELECT * EXCLUDE(a, a)
FROM table1

# if EXCEPT all the columns, query should still succeed but return empty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @Jefffrey i would also add more tricky test cases, where column names are in different order, duplicated.
like

SELECT * EXCEPT(d, b, c, a, a, b, c, d)
FROM table1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, added tests to cover this

statement ok
SELECT * EXCEPT(a, b, c, d)
FROM table1

# EXCLUDE order shouldn't matter
query II
SELECT * EXCLUDE(b, a)
FROM table1
ORDER BY c
LIMIT 5
----
100 1000
200 2000

# EXCLUDE with out of order but duplicate columns should error
statement error DataFusion error: Error during planning: EXCLUDE or EXCEPT contains duplicate column names
SELECT * EXCLUDE(d, b, c, a, a, b, c, d)
FROM table1

# run below query in multi partitions
statement ok
set datafusion.execution.target_partitions = 2;
Expand Down