feat(rust)!: return Box<RecordBatchReader + 'static> for caller flexibility#3904
feat(rust)!: return Box<RecordBatchReader + 'static> for caller flexibility#3904lidavidm merged 1 commit intoapache:mainfrom
Box<RecordBatchReader + 'static> for caller flexibility#3904Conversation
|
CC @eitsupi as well. That said, I'm still thinking about whether it should be |
felipecrv
left a comment
There was a problem hiding this comment.
This is a good initial step. It's the first change I added to my fork. But real-world usage really requires a Box<dyn RecordBatchReader>.
The impl RecordBatchReader only covers cases where you get the reader and fully consume it right after the call.
paleolimbot
left a comment
There was a problem hiding this comment.
I'm not an expert on Rust lifetimes but this does seem like an improvement. My specific use case is writing a driver that doesn't have lifetime constraints on its readers (DataFusion) where I'm immediately exporting to FFI where the lifetime constraints are no longer enforced, so I'm probably a poor judge on both the use and author side of this.
|
Ok. In that case I'll update this PR to go all the way. I figure it's better to have only one breaking change. |
Box<RecordBatchReader + 'static> for caller flexibility
This avoids inadvertently tying the result lifetime to the lifetimes of any input arguments. We discussed more drastic changes like changing the result to have 'static or even using Box<Reader + 'static>, but this opts for the most conservative change. Closes apache#2694.
|
Rebased; I'll merge if there's no objections |
Your intuition is right! Returning an |
|
Thank you @lidavidm. This is great. |
This avoids inadvertently tying the result lifetime to the lifetimes of any input arguments. We discussed more drastic changes like changing the result to have 'static or even using Box<Reader + 'static>, but this opts for the most conservative change.
Closes #2694.