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

Function garrow_array_dictionary_encode

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

* garrow_array_dictionary_encode: * @array: A #GArrowArray. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): * A newly created #GArrowDictionaryArray for the @array on success, * %NULL on error. * * Since: 0.8.0 */

Source from the content-addressed store, hash-verified

4946 * Since: 0.8.0
4947 */
4948GArrowDictionaryArray *
4949garrow_array_dictionary_encode(GArrowArray *array, GError **error)
4950{
4951 auto arrow_array = garrow_array_get_raw(array);
4952 auto arrow_dictionary_encoded_datum = arrow::compute::DictionaryEncode(arrow_array);
4953 if (garrow::check(error, arrow_dictionary_encoded_datum, [&]() {
4954 std::stringstream message;
4955 message << "[array][dictionary-encode] <";
4956 message << arrow_array->type()->ToString();
4957 message << ">";
4958 return message.str();
4959 })) {
4960 auto arrow_dictionary_encoded_array = (*arrow_dictionary_encoded_datum).make_array();
4961 auto dictionary_encoded_array = garrow_array_new_raw(&arrow_dictionary_encoded_array);
4962 return GARROW_DICTIONARY_ARRAY(dictionary_encoded_array);
4963 } else {
4964 return NULL;
4965 }
4966}
4967
4968/**
4969 * garrow_array_count:

Callers

nothing calls this directly

Calls 8

DictionaryEncodeFunction · 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