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

Function readFlatVector

bolt/vector/VectorSaver.cpp:284–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284VectorPtr readFlatVector(
285 const TypePtr& type,
286 vector_size_t size,
287 std::istream& in,
288 memory::MemoryPool* pool) {
289 // Nulls buffer.
290 BufferPtr nulls = readOptionalBuffer(in, pool);
291
292 // Values buffer.
293 BufferPtr values = readOptionalBuffer(in, pool);
294
295 // String buffers.
296 std::vector<BufferPtr> stringBuffers;
297 if (type->isVarchar() || type->isVarbinary()) {
298 int32_t numStringBuffers = read<int32_t>(in);
299 for (auto i = 0; i < numStringBuffers; ++i) {
300 stringBuffers.push_back(readBuffer(in, pool));
301 }
302
303 // Update the pointers in the StringViews.
304 if (values) {
305 restoreVectorStringViews(size, values, stringBuffers);
306 }
307 }
308
309 return BOLT_DYNAMIC_SCALAR_TYPE_DISPATCH_ALL(
310 createFlat, type->kind(), type, size, pool, nulls, values, stringBuffers);
311}
312
313template <TypeKind kind>
314void writeScalarConstant(const BaseVector& vector, std::ostream& out) {

Callers 2

restoreVectorFunction · 0.70
nextMethod · 0.50

Calls 5

readOptionalBufferFunction · 0.85
readBufferFunction · 0.85
restoreVectorStringViewsFunction · 0.85
push_backMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected