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

add into_inner method to ArrowWriter #2491

Closed
jiacai2050 opened this issue Aug 18, 2022 · 3 comments · Fixed by #2498
Closed

add into_inner method to ArrowWriter #2491

jiacai2050 opened this issue Aug 18, 2022 · 3 comments · Fixed by #2498
Labels
enhancement Any new improvement worthy of a entry in the changelog parquet Changes to the parquet crate

Comments

@jiacai2050
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

For now, there is no way to retrieve Writer passed into ArrowWriter back, this means that we have to use Arc(or something similar) to wrap Writer in order to get ownership.

Describe the solution you'd like

Add into_inner method to ArrowWriter, just like parquet2

Describe alternatives you've considered

Additional context

@jiacai2050 jiacai2050 added the enhancement Any new improvement worthy of a entry in the changelog label Aug 18, 2022
@tustvold
Copy link
Contributor

tustvold commented Aug 18, 2022

Have you tried passing &mut W to the writer instead?

See the example here - https://docs.rs/parquet/latest/parquet/arrow/arrow_writer/struct.ArrowWriter.html

TBC I think we should add this API, just trying to unblock you 😅

@jiacai2050
Copy link
Contributor Author

jiacai2050 commented Aug 18, 2022

&mut W is one solution, but not works for my case, I need ownership(or static lifetime) since if it's behind a trait object.

Will submit a PR later.

@tustvold
Copy link
Contributor

I need ownership(or static lifetime) since if it's behind a trait object.

FWIW trait objects need not have static lifetimes, but I concede your point that there are situations where a static lifetime is necessary to avoid self-referential structures.

@alamb alamb added arrow Changes to the arrow crate parquet Changes to the parquet crate and removed arrow Changes to the arrow crate labels Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants