You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "amunra (via GitHub)" <gi...@apache.org> on 2023/08/07 15:31:51 UTC
[GitHub] [arrow-rs] amunra opened a new issue, #4656: API bug: `batches_to_flight_data` forces clone
amunra opened a new issue, #4656:
URL: https://github.com/apache/arrow-rs/issues/4656
The API is pretty inconsistent, sometimes requiring a `Schema` and sometimes a `SchemaRef`.
For example I hold a `SchemaRef`, but `batches_to_flight_data` requires a `Schema`, forcing me to create a clone of the ref counted object.
Instead, the function should just take a `&Schema`.
```rust
pub fn batches_to_flight_data(
schema: Schema,
batches: Vec<RecordBatch>,
) -> Result<Vec<FlightData>, ArrowError> {
let options = IpcWriteOptions::default();
let schema_flight_data: FlightData = SchemaAsIpc::new(&schema, &options).into();
^___ it's borrowed later anyways!
```
--
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] jackwener commented on issue #4656: API improvement: `batches_to_flight_data` forces clone
Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on issue #4656:
URL: https://github.com/apache/arrow-rs/issues/4656#issuecomment-1668960787
Make sense to me
--
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 closed issue #4656: API improvement: `batches_to_flight_data` forces clone
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold closed issue #4656: API improvement: `batches_to_flight_data` forces clone
URL: https://github.com/apache/arrow-rs/issues/4656
--
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