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

Function scanArrowArrayList

src/common/arrow/arrow_array_scan.cpp:214–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212
213template<typename offsetsT>
214static void scanArrowArrayList(const ArrowSchema* schema, const ArrowArray* array,
215 ValueVector& outputVector, ArrowNullMaskTree* mask, uint64_t srcOffset, uint64_t dstOffset,
216 uint64_t count) {
217 auto offsets = ((const offsetsT*)array->buffers[1]) + srcOffset;
218 uint64_t auxDstPosition = function::NumericLimits<uint64_t>::maximum();
219
220 mask->copyToValueVector(&outputVector, dstOffset, count);
221
222 rowIter(outputVector, count, [&](auto i) {
223 auto curOffset = offsets[i], nextOffset = offsets[i + 1];
224 // don't check for validity, since we still need to update the offsets
225 auto newEntry = ListVector::addList(&outputVector, nextOffset - curOffset);
226 outputVector.setValue<list_entry_t>(i + dstOffset, newEntry);
227 if (auxDstPosition == function::NumericLimits<uint64_t>::maximum()) {
228 auxDstPosition = newEntry.offset;
229 }
230 });
231
232 if (auxDstPosition == function::NumericLimits<uint64_t>::maximum()) {
233 auxDstPosition = 0;
234 }
235
236 ValueVector* auxiliaryBuffer = ListVector::getDataVector(&outputVector);
237 ArrowConverter::fromArrowArray(schema->children[0], array->children[0], *auxiliaryBuffer,
238 mask->getChild(0), offsets[0] + array->children[0]->offset, auxDstPosition,
239 offsets[count] - offsets[0]);
240}
241
242template<typename offsetsT>
243static void scanArrowArrayListView(const ArrowSchema* schema, const ArrowArray* array,

Callers

nothing calls this directly

Calls 5

rowIterFunction · 0.85
addListFunction · 0.85
copyToValueVectorMethod · 0.80
getDataVectorFunction · 0.50
getChildMethod · 0.45

Tested by

no test coverage detected