-
Notifications
You must be signed in to change notification settings - Fork 2k
support format in options of COPY command #9744
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -514,6 +514,44 @@ OPTIONS ( | |
| ); | ||
|
|
||
|
|
||
| # Format Options Support with format in OPTIONS i.e. COPY { table_name | query } TO 'file_name' OPTIONS (format <format-name>, ...) | ||
|
|
||
| query I | ||
| COPY (select * from (values (1))) to 'test_files/scratch/copy/' | ||
| OPTIONS (format parquet); | ||
| ---- | ||
| 1 | ||
|
|
||
| query I | ||
| COPY (select * from (values (1))) to 'test_files/scratch/copy/' | ||
| OPTIONS (format parquet, compression 'zstd(10)'); | ||
| ---- | ||
| 1 | ||
|
|
||
| query I | ||
| COPY (select * from (values (1))) to 'test_files/scratch/copy/' | ||
| OPTIONS (format json, compression gzip); | ||
| ---- | ||
| 1 | ||
|
|
||
| query I | ||
| COPY (select * from (values (1))) to 'test_files/scratch/copy/' | ||
| OPTIONS ( | ||
| format csv, | ||
| has_header false, | ||
| compression xz, | ||
| datetime_format '%FT%H:%M:%S.%9f', | ||
| delimiter ';', | ||
| null_value 'NULLVAL' | ||
| ); | ||
| ---- | ||
| 1 | ||
|
|
||
| query error DataFusion error: Invalid or Unsupported Configuration: This feature is not implemented: Unknown FileType: NOTVALIDFORMAT | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error feels a bit long to me compared to others. We can reduce it to: I didn't do this because all the other branches were wrapping downstream errors with WDYT?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree the error could be nicer, but in this case I think we should keep the same basic pattern as the rest of the code (and perhaps update the pattern in a follow on PR) |
||
| COPY (select * from (values (1))) to 'test_files/scratch/copy/' | ||
| OPTIONS (format notvalidformat, compression 'zstd(5)'); | ||
|
|
||
|
|
||
| # Error cases: | ||
|
|
||
| # Copy from table with options | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.