Use file_name instead of path when checking for expected file extension#8265
Closed
andygrove wants to merge 1 commit intoapache:mainfrom
Closed
Use file_name instead of path when checking for expected file extension#8265andygrove wants to merge 1 commit intoapache:mainfrom
andygrove wants to merge 1 commit intoapache:mainfrom
Conversation
Member
Author
|
@Dandandan After applying this fix I was able to run queries in Ballista from your df33 branch. |
tustvold
reviewed
Nov 18, 2023
| for path in &table_paths { | ||
| let file_name = path.prefix().filename().unwrap_or_default(); | ||
| if !path.as_str().ends_with(&option_extension) && file_name.contains('.') { | ||
| if !file_name.ends_with(&option_extension) && file_name.contains('.') { |
Contributor
There was a problem hiding this comment.
I think this check is just ill-formed, if the ListingTableUrl is to a directory containing a . this check will reject it. I'm not sure what this check is here for tbh...
tustvold
reviewed
Nov 18, 2023
| for path in &table_paths { | ||
| let file_name = path.prefix().filename().unwrap_or_default(); | ||
| if !path.as_str().ends_with(&option_extension) && file_name.contains('.') { | ||
| if !file_name.ends_with(&option_extension) && file_name.contains('.') { |
Contributor
There was a problem hiding this comment.
Suggested change
| if !file_name.ends_with(&option_extension) && file_name.contains('.') { | |
| if !file_name.ends_with(&option_extension) && !path.is_collection() { |
Perhaps?
Member
Author
There was a problem hiding this comment.
That doesn't compile for me. Perhaps this method isn't available in the version of arrow-rs that we are currently using?
no method named `is_collection` found for reference `&ListingTableUrl` in the current scope
Contributor
There was a problem hiding this comment.
ListingTableUrl is a DataFusion concept, perhaps your checkout is behind main?
Member
Member
Author
|
Closing this in favor of #8267 |
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 #8264
Rationale for this change
Fix check for expected file extension to use
file_nameinstead ofpath, which could include a trailing/.Before this change
My Ballista benchmark fails with this confusing error:
After this change
No errors.
What changes are included in this PR?
Are these changes tested?
We have existing tests.
Are there any user-facing changes?