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

Function garrow_dictionary_array_new

c_glib/arrow-glib/composite-array.cpp:1941–1969  ·  view source on GitHub ↗

* garrow_dictionary_array_new: * @data_type: The data type of the dictionary array. * @indices: The indices of values in dictionary. * @dictionary: The dictionary of the dictionary array. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable): A newly created #GArrowDictionaryArray * or %NULL on error. * * Since: 0.8.0 */

Source from the content-addressed store, hash-verified

1939 * Since: 0.8.0
1940 */
1941GArrowDictionaryArray *
1942garrow_dictionary_array_new(GArrowDataType *data_type,
1943 GArrowArray *indices,
1944 GArrowArray *dictionary,
1945 GError **error)
1946{
1947 const auto arrow_data_type = garrow_data_type_get_raw(data_type);
1948 const auto arrow_indices = garrow_array_get_raw(indices);
1949 const auto arrow_dictionary = garrow_array_get_raw(dictionary);
1950 auto arrow_dictionary_array_result =
1951 arrow::DictionaryArray::FromArrays(arrow_data_type, arrow_indices, arrow_dictionary);
1952 if (garrow::check(error, arrow_dictionary_array_result, "[dictionary-array][new]")) {
1953 auto arrow_array =
1954 std::static_pointer_cast<arrow::Array>(*arrow_dictionary_array_result);
1955 auto dictionary_array = garrow_array_new_raw(&arrow_array,
1956 "array",
1957 &arrow_array,
1958 "value-data-type",
1959 data_type,
1960 "indices",
1961 indices,
1962 "dictionary",
1963 dictionary,
1964 NULL);
1965 return GARROW_DICTIONARY_ARRAY(dictionary_array);
1966 } else {
1967 return NULL;
1968 }
1969}
1970
1971/**
1972 * garrow_dictionary_array_get_indices:

Callers

nothing calls this directly

Calls 5

garrow_data_type_get_rawFunction · 0.85
FromArraysFunction · 0.85
garrow_array_new_rawFunction · 0.85
garrow_array_get_rawFunction · 0.70
checkFunction · 0.70

Tested by

no test coverage detected