* 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 */
| 1939 | * Since: 0.8.0 |
| 1940 | */ |
| 1941 | GArrowDictionaryArray * |
| 1942 | garrow_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: |
nothing calls this directly
no test coverage detected