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

Method copySerializedRow

bolt/exec/RowContainer.cpp:762–795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760}
761
762void RowContainer::copySerializedRow(
763 char* const serializedRow,
764 RowFormatInfo* const info) {
765 auto newRow = this->newRow();
766 memcpy(newRow, serializedRow, info->fixRowSize);
767 for (const auto& [isStr, rowColumn] : info->variableColumns) {
768 if (RowContainer::isNullAt(serializedRow, rowColumn)) {
769 continue;
770 }
771 if (isStr) {
772 StringView& sv =
773 *reinterpret_cast<StringView*>(serializedRow + rowColumn.offset());
774 if (!sv.isInline()) {
775 *(int32_t*)(newRow + rowSizeOffset_) += sv.size();
776 ByteOutputStream stream(stringAllocator_.get(), false, false);
777 const auto position = stringAllocator_->newWrite(stream);
778 stream.appendStringView(sv);
779 stringAllocator_->finishWrite(stream, 0);
780 valueAt<StringView>(newRow, rowColumn.offset()) =
781 StringView(reinterpret_cast<char*>(position.position), sv.size());
782 }
783 } else {
784 auto& sv = *reinterpret_cast<std::string_view*>(
785 serializedRow + rowColumn.offset());
786 *(int32_t*)(newRow + rowSizeOffset_) += sv.size();
787 ByteOutputStream stream(stringAllocator_.get(), false, false);
788 const auto position = stringAllocator_->newWrite(stream);
789 stream.appendStringView(sv);
790 stringAllocator_->finishWrite(stream, 0);
791 valueAt<std::string_view>(newRow, rowColumn.offset()) = std::string_view(
792 reinterpret_cast<char*>(position.position), sv.size());
793 }
794 }
795}
796
797void RowContainer::storeSerializedRow(
798 const FlatVector<StringView>& vector,

Callers 1

addSpilledRowInputMethod · 0.80

Calls 11

newRowMethod · 0.95
memcpyFunction · 0.85
isInlineMethod · 0.80
newWriteMethod · 0.80
finishWriteMethod · 0.80
isNullAtFunction · 0.50
StringViewClass · 0.50
offsetMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
appendStringViewMethod · 0.45

Tested by

no test coverage detected