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

Function restoreVector

bolt/vector/VectorSaver.cpp:661–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661VectorPtr restoreVector(std::istream& in, memory::MemoryPool* pool) {
662 BOLT_CHECK_NOT_NULL(pool);
663 // Encoding.
664 auto encoding = readEncoding(in);
665
666 // Type kind.
667 auto type = restoreType(in);
668
669 // Vector size.
670 auto size = read<int32_t>(in);
671
672 switch (encoding) {
673 case Encoding::kFlat:
674 if (type->isRow()) {
675 return readRowVector(type, size, in, pool);
676 } else if (type->isArray()) {
677 return readArrayVector(type, size, in, pool);
678 } else if (type->isMap()) {
679 return readMapVector(type, size, in, pool);
680 }
681 return readFlatVector(type, size, in, pool);
682 case Encoding::kConstant:
683 return readConstantVector(type, size, in, pool);
684 case Encoding::kDictionary:
685 return readDictionaryVector(type, size, in, pool);
686 case Encoding::kLazy:
687 return readLazyVector(type, size, in, pool);
688 default:
689 BOLT_UNREACHABLE();
690 }
691}
692
693VectorPtr restoreVectorFromFile(
694 const char* FOLLY_NONNULL filePath,

Callers 14

readConstantVectorFunction · 0.85
readDictionaryVectorFunction · 0.85
readRowVectorFunction · 0.85
readArrayVectorFunction · 0.85
readMapVectorFunction · 0.85
readLazyVectorFunction · 0.85
restoreVectorFromFileFunction · 0.85
takeRoundTripMethod · 0.85
TEST_FFunction · 0.85
createMethod · 0.85
createMethod · 0.85
replayMethod · 0.85

Calls 9

readEncodingFunction · 0.85
restoreTypeFunction · 0.85
readLazyVectorFunction · 0.85
readRowVectorFunction · 0.70
readArrayVectorFunction · 0.70
readMapVectorFunction · 0.70
readFlatVectorFunction · 0.70
readConstantVectorFunction · 0.70
readDictionaryVectorFunction · 0.70

Tested by 5

takeRoundTripMethod · 0.68
TEST_FFunction · 0.68
replayMethod · 0.68
restoreVectorMethod · 0.68
verifyDataAndSqlPathsMethod · 0.68