| 65 | |
| 66 | template <typename GArrowTypeNewRaw> |
| 67 | auto |
| 68 | garrow_take(arrow::Datum arrow_values, |
| 69 | arrow::Datum arrow_indices, |
| 70 | GArrowTakeOptions *options, |
| 71 | GArrowTypeNewRaw garrow_type_new_raw, |
| 72 | GError **error, |
| 73 | const gchar *tag) -> decltype(garrow_type_new_raw(arrow::Datum())) |
| 74 | { |
| 75 | arrow::Result<arrow::Datum> arrow_taken_datum; |
| 76 | if (options) { |
| 77 | auto arrow_options = garrow_take_options_get_raw(options); |
| 78 | arrow_taken_datum = arrow::compute::Take(arrow_values, arrow_indices, *arrow_options); |
| 79 | } else { |
| 80 | arrow_taken_datum = arrow::compute::Take(arrow_values, arrow_indices); |
| 81 | } |
| 82 | if (garrow::check(error, arrow_taken_datum, tag)) { |
| 83 | return garrow_type_new_raw(*arrow_taken_datum); |
| 84 | } else { |
| 85 | return NULL; |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | namespace { |
| 90 | gboolean |
no test coverage detected