-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Disable parallel reading for gziped ndjson file #9799
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
Conversation
alamb
left a comment
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.
Thank you for the contribution @Lordworms 🙏
I left a suggestion on how to clean up the code but I don't think it is required to merge this PR.
| async fn test_disable_parallel_for_json_gz() -> Result<()> { | ||
| let config = SessionConfig::new() | ||
| .with_repartition_file_scans(true) | ||
| .with_repartition_file_min_size(0) |
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.
👍
| let repartition_file_min_size = config.optimizer.repartition_file_min_size; | ||
| let repartition_file_min_size = | ||
| if self.file_compression_type == FileCompressionType::GZIP { | ||
| OptimizerOptions::default().repartition_file_min_size |
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.
I wonder it it would be simpler code to return None here
| OptimizerOptions::default().repartition_file_min_size | |
| None |
That way the rest of the code could be left alone.
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.
Sure
| target_partitions: usize, | ||
| config: &datafusion_common::config::ConfigOptions, | ||
| ) -> Result<Option<Arc<dyn ExecutionPlan>>> { | ||
| if self.file_compression_type == FileCompressionType::GZIP { |
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.
❤️
alamb
left a comment
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.
Thank you @Lordworms 🙏
Looks like there is a small CI failure otherwise this PR is ready to go
|
Thanks again @Lordworms and @Dandandan 🙏 |
* for debug * disable paralle reading for gziped ndjson file * directly return None * delete .gz * fix clippy
Which issue does this PR close?
Closes #9564
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?