Avoid metadata lookup for LocalFileSystem::read_ranges and chunked_stream - #621
Conversation
|
Doing some testing, it seems that avoiding Perhaps DataFusion can implement a LocalStorage that stores / caches the file descriptors for a query. |
alamb
left a comment
There was a problem hiding this comment.
The emulator test doesn't look related to this PR
I think these changes make sense, but
- There is some non trivial duplication
- There is still a call
open_file
I have some ideas on both counts. Let me propose a PR
Agreed
You mean outside |
As I played around with this I found that the challenge is that the metadata error is ignored sometimes when desired to get a better error message, but sometimes is needed. I haven't got anything yet that is great
Yeah, I meant in get_opts |
|
Am about out of time for now -- will check back later |
|
I have some thoughts about this one -- will see what I can do |
|
@Dandandan -- here is a proposal to simplify the error handling (I think it is somewhat tricky with all the corner cases, so refactoring into some functions makes it easier to see what is happening I think, and convince myself it is correct) |
Factor out error mapping, reduce duplication and simplify error handling
|
I took the liberty of pushing a commit to fix clippy and to simplify the error handling some more: 6ce2094 |
alamb
left a comment
There was a problem hiding this comment.
Thanks @Dandandan -- I think this (somewhat self-servingly) now looks quite good 😆
It makes sense to avoid the extra syscall to get metadata
Which issue does this PR close?
LocalFileSystem::read_ranges(and other methods) #614Rationale for this change
This is unnecessary overhead.
What changes are included in this PR?
Only error once the file operation errors.
Are there any user-facing changes?