* 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 */
| 6173 | * Since: 13.0.0 |
| 6174 | */ |
| 6175 | GArrowRunEndEncodedArray * |
| 6176 | garrow_array_run_end_encode(GArrowArray *array, |
| 6177 | GArrowRunEndEncodeOptions *options, |
| 6178 | GError **error) |
| 6179 | { |
| 6180 | auto arrow_array = garrow_array_get_raw(array); |
| 6181 | arrow::Result<arrow::Datum> arrow_run_end_encoded_datum_result; |
| 6182 | if (options) { |
| 6183 | auto arrow_options = garrow_run_end_encode_options_get_raw(options); |
| 6184 | arrow_run_end_encoded_datum_result = |
| 6185 | arrow::compute::RunEndEncode(arrow_array, *arrow_options); |
| 6186 | } else { |
| 6187 | arrow_run_end_encoded_datum_result = arrow::compute::RunEndEncode(arrow_array); |
| 6188 | } |
| 6189 | if (garrow::check(error, arrow_run_end_encoded_datum_result, [&]() { |
| 6190 | std::stringstream message; |
| 6191 | message << "[array][run-end-encode] <"; |
| 6192 | message << arrow_array->type()->ToString(); |
| 6193 | message << ">"; |
| 6194 | return message.str(); |
| 6195 | })) { |
| 6196 | auto arrow_run_end_encoded_array = (*arrow_run_end_encoded_datum_result).make_array(); |
| 6197 | auto run_end_encoded_array = garrow_array_new_raw(&arrow_run_end_encoded_array); |
| 6198 | return GARROW_RUN_END_ENCODED_ARRAY(run_end_encoded_array); |
| 6199 | } else { |
| 6200 | return nullptr; |
| 6201 | } |
| 6202 | } |
| 6203 | |
| 6204 | /** |
| 6205 | * garrow_run_end_encoded_array_decode: |
nothing calls this directly
no test coverage detected