You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/23 16:47:14 UTC
[GitHub] [arrow-rs] msalib opened a new issue, #1927: add a small doc example showing `ArrowWriter` being used with a cursor
msalib opened a new issue, #1927:
URL: https://github.com/apache/arrow-rs/issues/1927
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
Now (as of version 15.0) that we can use `std::io::Writer` implementers with `parquet::arrow::arrow_writer::ArrowWriter`, we can just use `std::io::Cursor` instead of the now deleted `InMemoryWriteableCursor`. But there are no docs or examples of how to do that.
**Describe the solution you'd like**
I'd love to see just a tiny doc example showing that use case, something like this:
```rust
fn batch_to_bytes(batch: &RecordBatch) -> Result<Vec<u8>> {
let mut buffer = std::io::Cursor::new(vec![]);
let mut writer = ArrowWriter::try_new(&mut buffer, batch.schema(), None)?;
writer.write(&batch)?;
writer.close()?;
Ok(buffer.into_inner())
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] nevi-me closed issue #1927: add a small doc example showing `ArrowWriter` being used with a cursor
Posted by GitBox <gi...@apache.org>.
nevi-me closed issue #1927: add a small doc example showing `ArrowWriter` being used with a cursor
URL: https://github.com/apache/arrow-rs/issues/1927
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] tustvold commented on issue #1927: add a small doc example showing `ArrowWriter` being used with a cursor
Posted by GitBox <gi...@apache.org>.
tustvold commented on issue #1927:
URL: https://github.com/apache/arrow-rs/issues/1927#issuecomment-1164681563
`InMemoryWriteableCursor` still exists it is just deprecated? You also can just use `std::Vec` directly
```
fn batch_to_bytes(batch: &RecordBatch) -> Result<Vec<u8>> {
let mut buffer = Vec::new();
let mut writer = ArrowWriter::try_new(&mut buffer, batch.schema(), None)?;
writer.write(&batch)?;
writer.close()?;
Ok(buffer)
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org