Skip to content

Commit

Permalink
Add test for reading back file created with FORMAT options (apache#9753)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored Apr 1, 2024
1 parent d8d521a commit b50f3aa
Showing 1 changed file with 23 additions and 2 deletions.
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

0 comments on commit b50f3aa

Please sign in to comment.