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

[BUG] Filter out marker files from glob scan #1999

Merged
merged 3 commits into from
Mar 11, 2024
Merged

Conversation

colin-ho
Copy link
Contributor

@colin-ho colin-ho commented Mar 9, 2024

Closes #1987

@github-actions github-actions bot added the bug Something isn't working label Mar 9, 2024
Copy link

codecov bot commented Mar 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.70%. Comparing base (bd78fa8) to head (9b4ec9f).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1999      +/-   ##
==========================================
+ Coverage   84.67%   84.70%   +0.03%     
==========================================
  Files          58       58              
  Lines        6363     6363              
==========================================
+ Hits         5388     5390       +2     
+ Misses        975      973       -2     

see 1 file with indirect coverage changes

@@ -309,6 +309,15 @@ fn _should_return(fm: &FileMetadata) -> bool {
{
false
}
// These are marker files used by Spark that we don't want to return
FileType::File
if fm.filepath.ends_with("_metadata")
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's do a .lower() on the file names and have these stored as constants?

Ideally it should also be configurable by the user but I think we can ignore that for now.

FileType::File
if MARKER_SUFFIXES
.iter()
.any(|suffix| fm.filepath.to_lowercase().ends_with(suffix)) =>
Copy link
Member

Choose a reason for hiding this comment

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

for _metadata, _common_metadata, and _success this may be bug prone.
Imagine you have a parquet file called image_metadata. this would filter that file out. Instead you want to find an exact match of filename where filename is basepath / filename for those 3.

@colin-ho colin-ho requested a review from samster25 March 11, 2024 18:25
@colin-ho colin-ho merged commit 118e141 into main Mar 11, 2024
29 checks passed
@colin-ho colin-ho deleted the colin/ignore-marker-files branch March 11, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore Spark marker files when performing Parquet Scans
3 participants