fix: respect DataFrameWriteOptions::with_single_file_output for paths without extensions #19931
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.
Which issue does this PR close?
DataFrameWriteOptions::with_single_file_outputproduces a directory #13323.Rationale for this change
When using
DataFrameWriteOptions::with_single_file_output(true), the setting was being ignored if the output path didn't have a file extension. For example:Would create a directory /path/to/output/ with files inside instead of a single file at /path/to/output.
This happened because the demuxer used a heuristic based solely on file extension, ignoring the explicit user setting.
What changes are included in this PR?
single_file_output: Option<bool>to FileSinkConfigAre these changes tested?
Are there any user-facing changes?
FileSinkConfig now has a new required field single_file_output: Option. Any code that constructs FileSinkConfig
directly will need to add this field. Set to None to preserve existing heuristic behavior.