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

Function restoreVectorStringViews

bolt/vector/VectorSaver.cpp:230–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void restoreVectorStringViews(
231 vector_size_t size,
232 const BufferPtr& strings,
233 const std::vector<BufferPtr>& stringBuffers) {
234 auto rawBytes = strings->as<char>();
235 auto rawValues = strings->asMutable<StringView>();
236 for (auto i = 0; i < size; ++i) {
237 auto value = rawValues[i];
238 if (!value.isInline()) {
239 auto offset = *reinterpret_cast<const int64_t*>(
240 rawBytes + i * sizeof(StringView) + 8);
241 rawValues[i] =
242 StringView(computeStringPointer(offset, stringBuffers), value.size());
243 }
244 }
245}
246
247bool isVarcharOrVarbinary(const BaseVector& vector) {
248 return vector.typeKind() == TypeKind::VARCHAR ||

Callers 1

readFlatVectorFunction · 0.85

Calls 4

computeStringPointerFunction · 0.85
isInlineMethod · 0.80
StringViewClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected