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

Method storeSerializedRow

bolt/exec/RowContainer.cpp:797–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795}
796
797void RowContainer::storeSerializedRow(
798 const FlatVector<StringView>& vector,
799 vector_size_t index,
800 char* row) {
801 BOLT_CHECK(!vector.isNullAt(index));
802 auto serialized = vector.valueAt(index);
803 size_t offset = 0;
804
805 const int32_t nullBytes = bits::nbytes(nullOffsets_.size());
806 memcpy(row + rowColumns_[0].nullByte(), serialized.data(), nullBytes);
807 offset += nullBytes;
808
809 RowSizeTracker tracker(row[rowSizeOffset_], *stringAllocator_);
810 for (auto i = 0; i < types_.size(); ++i) {
811 const auto& type = types_[i];
812 if (type->isFixedWidth()) {
813 const auto size = typeKindSize(type->kind());
814 memcpy(row + rowColumns_[i].offset(), serialized.data() + offset, size);
815 offset += size;
816 } else {
817 const auto size = storeVariableSizeAt(serialized.data() + offset, row, i);
818 offset += size;
819 }
820 }
821}
822
823void RowContainer::extractString(
824 StringView value,

Callers 2

TEST_FFunction · 0.80

Calls 11

nbytesFunction · 0.85
memcpyFunction · 0.85
typeKindSizeFunction · 0.85
isFixedWidthMethod · 0.80
isNullAtMethod · 0.45
valueAtMethod · 0.45
sizeMethod · 0.45
nullByteMethod · 0.45
dataMethod · 0.45
kindMethod · 0.45
offsetMethod · 0.45

Tested by 1

TEST_FFunction · 0.64