fix: repartitioned reads of CSV with custom line terminator #13677
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?
Closes #12328.
Rationale for this change
At this moment DF is unable to properly identify ranges after file repartitioning for CSV files with custom line terminator (bound calculation function considers only
\n
as a line separating character).Test failures are caused by
target_partitions = 4
(default for Datafusion sqllogictests engine/runner) andset repartition_file_min_size = 1
incsv_files.slt
executed before failing test -- these two settings trigger scan repartitioning, which is not supported.What changes are included in this PR?
File scan repartitioning functions used for plain-text files (CSV and NDJson -- though json reader don't have line separator option in its API) now aware of line terminator character.
Are these changes tested?
Sqllogictests for single-thread reading and repartitioned reading of CSV with custom line separator.
Are there any user-facing changes?
No.