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

Method combineWrappers

bolt/vector/DecodedVector.cpp:150–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150void DecodedVector::combineWrappers(
151 const BaseVector* vector,
152 const SelectivityVector* rows,
153 int numLevels) {
154 auto topEncoding = vector->encoding();
155 BaseVector* values = nullptr;
156 if (topEncoding == VectorEncoding::Simple::DICTIONARY) {
157 indices_ = vector->wrapInfo()->as<vector_size_t>();
158 values = vector->valueVector().get();
159 nulls_ = vector->rawNulls();
160 if (nulls_) {
161 hasExtraNulls_ = true;
162 mayHaveNulls_ = true;
163 }
164 } else {
165 BOLT_FAIL(
166 "Unsupported wrapper encoding: {}",
167 VectorEncoding::mapSimpleToName(topEncoding));
168 }
169 int32_t levelCounter = 0;
170 for (;;) {
171 if (numLevels != -1 && ++levelCounter == numLevels) {
172 baseVector_ = values;
173 return;
174 }
175
176 auto encoding = values->encoding();
177 if (isLazy(encoding) &&
178 (loadLazy_ || values->asUnchecked<LazyVector>()->isLoaded())) {
179 values = values->loadedVector();
180 encoding = values->encoding();
181 }
182
183 switch (encoding) {
184 case VectorEncoding::Simple::LAZY:
185 case VectorEncoding::Simple::CONSTANT:
186 case VectorEncoding::Simple::FLAT:
187 case VectorEncoding::Simple::BIASED:
188 case VectorEncoding::Simple::ROW:
189 case VectorEncoding::Simple::VARIANT:
190 case VectorEncoding::Simple::ARRAY:
191 case VectorEncoding::Simple::MAP:
192 setBaseData(*values, rows);
193 return;
194 case VectorEncoding::Simple::DICTIONARY: {
195 applyDictionaryWrapper(*values, rows);
196 values = values->valueVector().get();
197 break;
198 }
199 default:
200 BOLT_CHECK(false, "Unsupported vector encoding");
201 }
202 }
203}
204
205void DecodedVector::applyDictionaryWrapper(
206 const BaseVector& dictionaryVector,

Callers

nothing calls this directly

Calls 8

mapSimpleToNameFunction · 0.85
rawNullsMethod · 0.80
isLoadedMethod · 0.80
isLazyFunction · 0.70
encodingMethod · 0.45
wrapInfoMethod · 0.45
getMethod · 0.45
loadedVectorMethod · 0.45

Tested by

no test coverage detected