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

Function garrow_chunked_array_new

c_glib/arrow-glib/chunked-array.cpp:159–175  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

157 * A newly created #GArrowChunkedArray or %NULL on error.
158 */
159GArrowChunkedArray *
160garrow_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:

Callers

nothing calls this directly

Calls 5

push_backMethod · 0.80
garrow_array_get_rawFunction · 0.70
checkFunction · 0.70
MakeFunction · 0.50

Tested by

no test coverage detected