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

Function garrow_array_dictionary_encode

c_glib/arrow-glib/compute.cpp:4993–5011  ·  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

4991 * Since: 0.8.0
4992 */
4993GArrowDictionaryArray *
4994garrow_array_dictionary_encode(GArrowArray *array, GError **error)
4995{
4996 auto arrow_array = garrow_array_get_raw(array);
4997 auto arrow_dictionary_encoded_datum = arrow::compute::DictionaryEncode(arrow_array);
4998 if (garrow::check(error, arrow_dictionary_encoded_datum, [&]() {
4999 std::stringstream message;
5000 message << "[array][dictionary-encode] <";
5001 message << arrow_array->type()->ToString();
5002 message << ">";
5003 return message.str();
5004 })) {
5005 auto arrow_dictionary_encoded_array = (*arrow_dictionary_encoded_datum).make_array();
5006 auto dictionary_encoded_array = garrow_array_new_raw(&arrow_dictionary_encoded_array);
5007 return GARROW_DICTIONARY_ARRAY(dictionary_encoded_array);
5008 } else {
5009 return NULL;
5010 }
5011}
5012
5013/**
5014 * 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