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

Method decode

bolt/vector/DecodedVector.cpp:61–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59};
60
61void DecodedVector::decode(
62 const BaseVector& vector,
63 const SelectivityVector* rows,
64 bool loadLazy) {
65 reset(end(vector.size(), rows));
66 loadLazy_ = loadLazy;
67 bool isTopLevelLazyAndLoaded =
68 vector.isLazy() && vector.asUnchecked<LazyVector>()->isLoaded();
69 if (isTopLevelLazyAndLoaded || (loadLazy_ && isLazyNotLoaded(vector))) {
70 decode(*vector.loadedVector(), rows, loadLazy);
71 return;
72 }
73
74 auto encoding = vector.encoding();
75 switch (encoding) {
76 case VectorEncoding::Simple::FLAT:
77 case VectorEncoding::Simple::BIASED:
78 case VectorEncoding::Simple::ROW:
79 case VectorEncoding::Simple::VARIANT:
80 case VectorEncoding::Simple::ARRAY:
81 case VectorEncoding::Simple::MAP:
82 case VectorEncoding::Simple::LAZY:
83 isIdentityMapping_ = true;
84 setBaseData(vector, rows);
85 return;
86 case VectorEncoding::Simple::CONSTANT: {
87 isConstantMapping_ = true;
88 if (isLazyNotLoaded(vector)) {
89 baseVector_ = vector.valueVector().get();
90 constantIndex_ = vector.wrapInfo()->as<vector_size_t>()[0];
91 mayHaveNulls_ = true;
92 } else {
93 setBaseData(vector, rows);
94 }
95 break;
96 }
97 case VectorEncoding::Simple::DICTIONARY:
98 case VectorEncoding::Simple::SEQUENCE: {
99 combineWrappers(&vector, rows);
100 break;
101 }
102 default:
103 BOLT_FAIL(
104 "Unsupported vector encoding: {}",
105 VectorEncoding::mapSimpleToName(encoding));
106 }
107}
108
109void DecodedVector::makeIndices(
110 const BaseVector& vector,

Callers 4

ensureLoadedRowsImplMethod · 0.45
ensureLoadedRowsMethod · 0.45
TEST_FFunction · 0.45

Calls 10

resetFunction · 0.85
isLazyNotLoadedFunction · 0.85
mapSimpleToNameFunction · 0.85
isLoadedMethod · 0.80
decodeFunction · 0.50
sizeMethod · 0.45
loadedVectorMethod · 0.45
encodingMethod · 0.45
getMethod · 0.45
wrapInfoMethod · 0.45

Tested by 1

TEST_FFunction · 0.36