MCPcopy Create free account
hub / github.com/bytedance/bolt / readRowVector

Function readRowVector

bolt/vector/VectorSaver.cpp:451–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451VectorPtr readRowVector(
452 const TypePtr& type,
453 vector_size_t size,
454 std::istream& in,
455 memory::MemoryPool* pool) {
456 // Nulls buffer.
457 BufferPtr nulls = readOptionalBuffer(in, pool);
458
459 // Child vectors.
460 auto numChildren = read<int32_t>(in);
461 std::vector<VectorPtr> children;
462 children.reserve(numChildren);
463 for (auto i = 0; i < numChildren; ++i) {
464 bool present = read<bool>(in);
465 if (present) {
466 children.push_back(restoreVector(in, pool));
467 } else {
468 children.push_back(nullptr);
469 }
470 }
471
472 return std::make_shared<RowVector>(pool, type, nulls, size, children);
473}
474
475void writeArrayVector(const BaseVector& vector, std::ostream& out) {
476 // Nulls buffer.

Callers 1

restoreVectorFunction · 0.70

Calls 4

readOptionalBufferFunction · 0.85
restoreVectorFunction · 0.85
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected