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

Function readConstantVector

bolt/vector/VectorSaver.cpp:377–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377VectorPtr readConstantVector(
378 const TypePtr& type,
379 vector_size_t size,
380 std::istream& in,
381 memory::MemoryPool* pool) {
382 // Is-null flag.
383 auto isNull = read<bool>(in);
384
385 if (isNull) {
386 return BaseVector::createNullConstant(type, size, pool);
387 }
388
389 bool scalar = read<bool>(in);
390 if (scalar) {
391 return BOLT_DYNAMIC_SCALAR_TYPE_DISPATCH_ALL(
392 readConstant, type->kind(), type, size, pool, in);
393 }
394
395 auto baseVector = restoreVector(in, pool);
396 auto baseIndex = read<int32_t>(in);
397
398 return BaseVector::wrapInConstant(size, baseIndex, baseVector);
399}
400
401void writeDictionaryVector(const BaseVector& vector, std::ostream& out) {
402 // Nulls buffer.

Callers 1

restoreVectorFunction · 0.70

Calls 2

restoreVectorFunction · 0.85
kindMethod · 0.45

Tested by

no test coverage detected