* garrow_chunked_array_new: * @chunks: (element-type GArrowArray): The array chunks. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable): * A newly created #GArrowChunkedArray or %NULL on error. */
| 157 | * A newly created #GArrowChunkedArray or %NULL on error. |
| 158 | */ |
| 159 | GArrowChunkedArray * |
| 160 | garrow_chunked_array_new(GList *chunks, GError **error) |
| 161 | { |
| 162 | std::vector<std::shared_ptr<arrow::Array>> arrow_chunks; |
| 163 | for (GList *node = chunks; node; node = node->next) { |
| 164 | GArrowArray *chunk = GARROW_ARRAY(node->data); |
| 165 | arrow_chunks.push_back(garrow_array_get_raw(chunk)); |
| 166 | } |
| 167 | |
| 168 | auto arrow_chunked_array_result = arrow::ChunkedArray::Make(arrow_chunks); |
| 169 | if (garrow::check(error, arrow_chunked_array_result, "[chunked-array][new]")) { |
| 170 | auto arrow_chunked_array = *arrow_chunked_array_result; |
| 171 | return garrow_chunked_array_new_raw(&arrow_chunked_array); |
| 172 | } else { |
| 173 | return nullptr; |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * garrow_chunked_array_new_empty: |
nothing calls this directly
no test coverage detected