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

Method extractString

bolt/exec/RowContainer.cpp:823–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

821}
822
823void RowContainer::extractString(
824 StringView value,
825 FlatVector<StringView>* values,
826 vector_size_t index,
827 bool exactSize) {
828 if (value.isInline() ||
829 reinterpret_cast<const HashStringAllocator::Header*>(value.data())[-1]
830 .size() >= value.size()) {
831 // The string is inline or all in one piece out of line.
832 values->setStringViewValue(index, value, exactSize);
833 return;
834 }
835 auto rawBuffer = values->getRawStringBufferWithSpace(value.size(), exactSize);
836 auto stream = HashStringAllocator::prepareRead(
837 HashStringAllocator::headerOf(value.data()));
838 stream->readBytes(rawBuffer, value.size());
839 values->setNoCopy(index, StringView(rawBuffer, value.size()));
840}
841
842void RowContainer::storeComplexType(
843 const DecodedVector& decoded,

Callers

nothing calls this directly

Calls 9

prepareReadFunction · 0.85
isInlineMethod · 0.80
setStringViewValueMethod · 0.80
StringViewClass · 0.50
sizeMethod · 0.45
dataMethod · 0.45
readBytesMethod · 0.45
setNoCopyMethod · 0.45

Tested by

no test coverage detected