fix: repartitioned reads of CSV with custom line terminator#13677
Merged
korowa merged 1 commit intoapache:mainfrom Dec 7, 2024
Merged
fix: repartitioned reads of CSV with custom line terminator#13677korowa merged 1 commit intoapache:mainfrom
korowa merged 1 commit intoapache:mainfrom
Conversation
6a7c341 to
94c41be
Compare
alamb
approved these changes
Dec 6, 2024
Contributor
alamb
left a comment
There was a problem hiding this comment.
Thank you @korowa -- this makes sense to me
I also ran the tests in this PR without the corresponding code change and verified the test failed (and thus covers the feature)
Running "csv_files.slt"
External error: query failed: DataFusion error: Object Store error: Generic LocalFileSystem error: Requested range was invalid
[SQL] select * from stored_table_with_cr_terminator order by col1;
at test_files/csv_files.slt:369
Error: Execution("1 failures")
error: test failed, to rerun pass `-p datafusion-sqllogictest --test sqllogictests`
Caused by:
process didn't exit successfully: `/Users/andrewlamb/Software/datafusion/target/debug/deps/sqllogictests-7c41483884b46406 csv_file` (exit status: 1)
zhuliquan
pushed a commit
to zhuliquan/datafusion
that referenced
this pull request
Dec 11, 2024
5 tasks
zhuliquan
pushed a commit
to zhuliquan/datafusion
that referenced
this pull request
Dec 15, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
\nas a line separating character).Test failures are caused by
target_partitions = 4(default for Datafusion sqllogictests engine/runner) andset repartition_file_min_size = 1incsv_files.sltexecuted 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.