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

Remove SINGLE_FILE_OUTPUT option from COPY statement #8621

Closed
alamb opened this issue Dec 21, 2023 · 3 comments · Fixed by #9041
Closed

Remove SINGLE_FILE_OUTPUT option from COPY statement #8621

alamb opened this issue Dec 21, 2023 · 3 comments · Fixed by #9041
Labels
enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Dec 21, 2023

Is your feature request related to a problem or challenge?

Figuring out how to use SINGLE_FILE_OUTPUT while writing https://github.com/apache/arrow-datafusion/blob/98a5a4eb1ea1277f5fe001e1c7602b37592452f1/datafusion/sqllogictest/test_files/repartition_scan.slt#L35-L38 was actually quite painful for me.

This option controls if the COPY statement writes a single file or multiple files into a directory.

Having datafusion automatically figure out that writing to foo.parquet should be a single file certainly would be a better UX in my opinion

Describe the solution you'd like

Yes, COPY still uses single_file_output option of the FileSinkConfig struct. We could potentially update COPY to instead rely on inference based on the path rather than an explicit option. E.g. copy table to file.parquet vs copy table to folder/. Then single_file_output could be removed entirely.

Describe alternatives you've considered

No response

Additional context

@devinjdangelo removed the corresponding option from LIstingTable (aka CREATE EXTERNAL TABLE) in #8604 and suggsted this in #8604 (comment)

@alamb alamb added the enhancement New feature or request label Dec 21, 2023
@alamb alamb changed the title Remove SINGLE_FILE option from COPY statement Remove SINGLE_FILE_OUTPUT option from COPY statement Dec 21, 2023
@yyy1000
Copy link
Contributor

yyy1000 commented Jan 25, 2024

I could try to help it. :)

@alamb
Copy link
Contributor Author

alamb commented Jan 25, 2024

I could try to help it. :)

A machine!

@yyy1000
Copy link
Contributor

yyy1000 commented Jan 29, 2024

I created PR #9041 may help this. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants