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

Add test for reading back file created with COPY ... OPTIONS (FORMAT..) options #9753

Merged
merged 3 commits into from
Apr 1, 2024
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
25 changes: 23 additions & 2 deletions datafusion/sqllogictest/test_files/copy.slt
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,31 @@ OPTIONS (
);


# Format Options Support with format in OPTIONS i.e. COPY { table_name | query } TO 'file_name' OPTIONS (format <format-name>, ...)
# Format Options Support with format in OPTIONS
#
# i.e. COPY { table_name | query } TO 'file_name' OPTIONS (format <format-name>, ...)

# Ensure that the format is set in the OPTIONS, not extension
query I
COPY (select * from (values (1))) to 'test_files/scratch/copy/'
COPY (select * from (values (1))) to 'test_files/scratch/copy/foo.dat'
OPTIONS (format parquet);
----
1

statement ok
CREATE EXTERNAL TABLE foo_dat STORED AS PARQUET LOCATION 'test_files/scratch/copy/foo.dat';

query I
select * from foo_dat;
----
1

statement ok
DROP TABLE foo_dat;


query I
COPY (select * from (values (1))) to 'test_files/scratch/copy'
OPTIONS (format parquet);
----
1
Expand Down
Loading