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

Support for Async JSON Writer #3742

Closed
metesynnada opened this issue Feb 21, 2023 · 3 comments · Fixed by #3824
Closed

Support for Async JSON Writer #3742

metesynnada opened this issue Feb 21, 2023 · 3 comments · Fixed by #3824
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog object-store Object Store Interface

Comments

@metesynnada
Copy link
Contributor

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

I want an async JSON writer to use it in an async context. The current implementation is blocking even if we are in the tokio environment.

Describe the solution you'd like
A writer using tokio::io::AsyncWrite might be the solution.

Describe alternatives you've considered
NA

Additional context
Na

@metesynnada metesynnada added the enhancement Any new improvement worthy of a entry in the changelog label Feb 21, 2023
@tustvold
Copy link
Contributor

Same as commented on the CSV writer ticket, #3740 (comment), I would recommend implementing this by buffering an encoded batch in memory using the existing writer, prior to flushing it via async. This avoids code duplication, is more generic, and is likely significantly faster. It has been my experience that async does not optimise very well, especially in tight loops, and is best kept independent of the hot synchronous code.

@tustvold
Copy link
Contributor

label_issue.py automatically added labels {'arrow'} from #3

@tustvold tustvold added the object-store Object Store Interface label Mar 24, 2023
@tustvold
Copy link
Contributor

label_issue.py automatically added labels {'object-store'} from #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog object-store Object Store Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants