* garrow_output_stream_write_tensor: * @stream: A #GArrowOutputStream. * @tensor: A #GArrowTensor to be written. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: The number of written bytes on success, -1 on error. * * Since: 0.4.0 */
| 203 | * Since: 0.4.0 |
| 204 | */ |
| 205 | gint64 |
| 206 | garrow_output_stream_write_tensor(GArrowOutputStream *stream, |
| 207 | GArrowTensor *tensor, |
| 208 | GError **error) |
| 209 | { |
| 210 | auto arrow_stream = garrow_output_stream_get_raw(stream); |
| 211 | auto arrow_tensor = garrow_tensor_get_raw(tensor); |
| 212 | int32_t metadata_length; |
| 213 | int64_t body_length; |
| 214 | auto status = arrow::ipc::WriteTensor(*arrow_tensor, |
| 215 | arrow_stream.get(), |
| 216 | &metadata_length, |
| 217 | &body_length); |
| 218 | if (garrow::check(error, status, "[output-stream][write-tensor]")) { |
| 219 | return metadata_length + body_length; |
| 220 | } else { |
| 221 | return -1; |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * garrow_output_stream_write_record_batch: |
nothing calls this directly
no test coverage detected