MCPcopy Create free account
hub / github.com/apache/arrow / garrow_array_run_end_encode

Function garrow_array_run_end_encode

c_glib/arrow-glib/compute.cpp:6175–6202  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

6173 * Since: 13.0.0
6174 */
6175GArrowRunEndEncodedArray *
6176garrow_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:

Callers

nothing calls this directly

Calls 9

RunEndEncodeFunction · 0.85
garrow_array_new_rawFunction · 0.85
strMethod · 0.80
make_arrayMethod · 0.80
garrow_array_get_rawFunction · 0.70
checkFunction · 0.70
ToStringMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected