* garrow_array_view: * @array: A #GArrowArray. * @return_type: A #GArrowDataType of the returned view. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): A zero-copy view of this array * with the given type. This method checks if the `return_type` are * layout-compatible. * * Since: 0.15.0 */
| 1215 | * Since: 0.15.0 |
| 1216 | */ |
| 1217 | GArrowArray * |
| 1218 | garrow_array_view(GArrowArray *array, GArrowDataType *return_type, GError **error) |
| 1219 | { |
| 1220 | auto arrow_array_raw = garrow_array_get_raw(array); |
| 1221 | auto arrow_return_type = garrow_data_type_get_raw(return_type); |
| 1222 | auto arrow_array = arrow_array_raw->View(arrow_return_type); |
| 1223 | if (garrow::check(error, arrow_array, "[array][view]")) { |
| 1224 | return garrow_array_new_raw(&(*arrow_array)); |
| 1225 | } else { |
| 1226 | return NULL; |
| 1227 | } |
| 1228 | } |
| 1229 | |
| 1230 | /** |
| 1231 | * garrow_array_diff_unified: |
nothing calls this directly
no test coverage detected