-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 ListingTable single_file option #8604
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,12 +135,8 @@ impl TableProviderFactory for ListingTableFactory { | |
|
||
let mut statement_options = StatementOptions::from(&cmd.options); | ||
|
||
// Extract ListingTable specific options if present or set default | ||
let single_file = statement_options | ||
.take_bool_option("single_file")? | ||
.unwrap_or(false); | ||
|
||
// Backwards compatibility (#8547) | ||
// Backwards compatibility (#8547), discard deprecated options | ||
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. 👍 |
||
statement_options.take_bool_option("single_file")?; | ||
if let Some(s) = statement_options.take_str_option("insert_mode") { | ||
if !s.eq_ignore_ascii_case("append_new_files") { | ||
return plan_err!("Unknown or unsupported insert mode {s}. Only append_new_files supported"); | ||
|
@@ -195,7 +191,6 @@ impl TableProviderFactory for ListingTableFactory { | |
.with_target_partitions(state.config().target_partitions()) | ||
.with_table_partition_cols(table_partition_cols) | ||
.with_file_sort_order(cmd.order_exprs.clone()) | ||
.with_single_file(single_file) | ||
.with_write_options(file_type_writer_options); | ||
|
||
let resolved_schema = match provided_schema { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this got me thinking we can remove the option from the FileSInkConfig itself.
However I see how that this PR is removing the
single_file
option from the read side (the ListingTable) but it can also potentially be important for the write side (aka a COPY statement)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 that certainly would be a better UX in my opinion (figuring out to use SINGLE_FILE in https://github.com/apache/arrow-datafusion/blob/98a5a4eb1ea1277f5fe001e1c7602b37592452f1/datafusion/sqllogictest/test_files/repartition_scan.slt#L35-L38 was actually quite painful for me)
Shall I propose a ticket to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #8621 to track removing SINGLE_FILE_OUTPUT completely