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:6130–6157  ·  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

6128 * Since: 13.0.0
6129 */
6130GArrowRunEndEncodedArray *
6131garrow_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:

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