MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / toArray

Method toArray

src/common/arrow/arrow_row_batch.cpp:993–1013  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

991}
992
993ArrowArray ArrowRowBatch::toArray(const std::vector<LogicalType>& types) {
994 auto rootHolder = std::make_unique<ArrowVector>();
995 ArrowArray result{};
996 rootHolder->childPointers.resize(vectors.size());
997 result.children = rootHolder->childPointers.data();
998 result.n_children = (std::int64_t)vectors.size();
999 result.length = numTuples;
1000 result.n_buffers = 1;
1001 result.buffers = rootHolder->buffers.data(); // no actual buffer
1002 result.offset = 0;
1003 result.null_count = 0;
1004 result.dictionary = nullptr;
1005 rootHolder->childData = std::move(vectors);
1006 for (auto i = 0u; i < rootHolder->childData.size(); i++) {
1007 rootHolder->childPointers[i] =
1008 convertVectorToArray(*rootHolder->childData[i], types[i], fallbackExtensionTypes);
1009 }
1010 result.private_data = rootHolder.release();
1011 result.release = releaseArrowVector;
1012 return result;
1013}
1014
1015void ArrowRowBatch::append(const processor::FlatTuple& tuple) {
1016 for (auto i = 0u; i < vectors.size(); i++) {

Callers 3

executeInternalMethod · 0.80
getNextArrowChunkMethod · 0.80
getArrayMethod · 0.80

Calls 4

releaseMethod · 0.80
resizeMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected