* garrow_array_run_end_encode: * @array: A #GArrowArray. * @options: (nullable): A #GArrowRunEndEncodeOptions. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): * A newly created #GArrowRunEndEncodeArray for the @array on success, * %NULL on error. * * Since: 13.0.0 */
| 6128 | * Since: 13.0.0 |
| 6129 | */ |
| 6130 | GArrowRunEndEncodedArray * |
| 6131 | garrow_array_run_end_encode(GArrowArray *array, |
| 6132 | GArrowRunEndEncodeOptions *options, |
| 6133 | GError **error) |
| 6134 | { |
| 6135 | auto arrow_array = garrow_array_get_raw(array); |
| 6136 | arrow::Result<arrow::Datum> arrow_run_end_encoded_datum_result; |
| 6137 | if (options) { |
| 6138 | auto arrow_options = garrow_run_end_encode_options_get_raw(options); |
| 6139 | arrow_run_end_encoded_datum_result = |
| 6140 | arrow::compute::RunEndEncode(arrow_array, *arrow_options); |
| 6141 | } else { |
| 6142 | arrow_run_end_encoded_datum_result = arrow::compute::RunEndEncode(arrow_array); |
| 6143 | } |
| 6144 | if (garrow::check(error, arrow_run_end_encoded_datum_result, [&]() { |
| 6145 | std::stringstream message; |
| 6146 | message << "[array][run-end-encode] <"; |
| 6147 | message << arrow_array->type()->ToString(); |
| 6148 | message << ">"; |
| 6149 | return message.str(); |
| 6150 | })) { |
| 6151 | auto arrow_run_end_encoded_array = (*arrow_run_end_encoded_datum_result).make_array(); |
| 6152 | auto run_end_encoded_array = garrow_array_new_raw(&arrow_run_end_encoded_array); |
| 6153 | return GARROW_RUN_END_ENCODED_ARRAY(run_end_encoded_array); |
| 6154 | } else { |
| 6155 | return nullptr; |
| 6156 | } |
| 6157 | } |
| 6158 | |
| 6159 | /** |
| 6160 | * garrow_run_end_encoded_array_decode: |
nothing calls this directly
no test coverage detected