| 760 | } |
| 761 | |
| 762 | void 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 | |
| 797 | void RowContainer::storeSerializedRow( |
| 798 | const FlatVector<StringView>& vector, |
no test coverage detected