Skip to content
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

fix: Fix corrupted reads for hive parts from cloud and projection pushdown failure on hive parts #17152

Merged
merged 3 commits into from
Jun 24, 2024

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Jun 24, 2024

Fixes #17104, #15823 (projection pd)

Fixes #17155 (corrupted reads)

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Jun 24, 2024
@nameexhaustion nameexhaustion self-assigned this Jun 24, 2024
@nameexhaustion nameexhaustion marked this pull request as ready for review June 24, 2024 06:58
@nameexhaustion nameexhaustion marked this pull request as draft June 24, 2024 06:58
@nameexhaustion nameexhaustion changed the title fix: Fix projection pushdown on hive parts fix: Fix corrupted reads from cloud and projection pushdown failure on hive parts Jun 24, 2024
));
},
};
let is_cloud = is_cloud_url(self.paths.first().unwrap());
Copy link
Collaborator Author

@nameexhaustion nameexhaustion Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the optimizer to replace a scan with DataFrameScan if the predicate filtered out all files (see below)

@@ -378,7 +378,7 @@ impl<'a> PredicatePushDown<'a> {
}
scan_type.remove_metadata();
}
if paths.is_empty() {
if new_paths.is_empty() {
Copy link
Collaborator Author

@nameexhaustion nameexhaustion Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discovered there was other code in place to ensure the invariant that a reader always has at least one path here, it would replace the scan node with a DataFrameScan but it wasn't being hit because it was incorrectly checking the old paths instead of new_paths. This changes the fix at #12575

@nameexhaustion nameexhaustion marked this pull request as ready for review June 24, 2024 10:25
@nameexhaustion nameexhaustion changed the title fix: Fix corrupted reads from cloud and projection pushdown failure on hive parts fix: Fix corrupted reads for hive parts from cloud and projection pushdown failure on hive parts Jun 24, 2024
@ritchie46
Copy link
Member

Thanks for the quick fix!

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.93%. Comparing base (6fe7efe) to head (33220d9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17152      +/-   ##
==========================================
+ Coverage   80.89%   80.93%   +0.03%     
==========================================
  Files        1456     1456              
  Lines      191355   191372      +17     
  Branches     2742     2742              
==========================================
+ Hits       154801   154890      +89     
+ Misses      36045    35973      -72     
  Partials      509      509              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit 514728b into pola-rs:main Jun 24, 2024
27 checks passed
@nameexhaustion nameexhaustion deleted the hive-proj-pd branch July 8, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
2 participants