| 840 | } |
| 841 | |
| 842 | void RowContainer::storeComplexType( |
| 843 | const DecodedVector& decoded, |
| 844 | vector_size_t index, |
| 845 | bool isKey, |
| 846 | char* row, |
| 847 | int32_t offset, |
| 848 | int32_t nullByte, |
| 849 | uint8_t nullMask) { |
| 850 | if (decoded.isNullAt(index)) { |
| 851 | BOLT_DCHECK(nullMask); |
| 852 | row[nullByte] |= nullMask; |
| 853 | valueAt<std::string_view>(row, offset) = std::string_view(); |
| 854 | return; |
| 855 | } |
| 856 | // RowSizeTracker tracker(row[rowSizeOffset_], *stringAllocator_); |
| 857 | ByteOutputStream stream(stringAllocator_.get(), false, false); |
| 858 | auto position = stringAllocator_->newWrite(stream); |
| 859 | ContainerRowSerdeOptions options{.isKey = isKey}; |
| 860 | ContainerRowSerde::serialize( |
| 861 | *decoded.base(), decoded.index(index), stream, options); |
| 862 | stringAllocator_->finishWrite(stream, 0); |
| 863 | |
| 864 | valueAt<std::string_view>(row, offset) = std::string_view( |
| 865 | reinterpret_cast<char*>(position.position), stream.size()); |
| 866 | |
| 867 | // TODO Fix ByteOutputStream::size() API. @oerling is looking into that. |
| 868 | // Fix the 'size' of the std::string_view. |
| 869 | // stream.size() is the capacity |
| 870 | // stream.size() - stream.remainingSize() is the size of the data + size of |
| 871 | // 'next' links (8 bytes per link). |
| 872 | auto readStream = prepareRead(row, offset); |
| 873 | const auto size = readStream->size(); |
| 874 | valueAt<std::string_view>(row, offset) = |
| 875 | std::string_view(reinterpret_cast<char*>(position.position), size); |
| 876 | |
| 877 | auto value = *reinterpret_cast<uint32_t*>(row + rowSizeOffset_) + size; |
| 878 | *reinterpret_cast<uint32_t*>(row + rowSizeOffset_) = |
| 879 | std::min<uint64_t>(value, std::numeric_limits<uint32_t>::max()); |
| 880 | } |
| 881 | |
| 882 | // static |
| 883 | int32_t RowContainer::compareStringAsc( |
nothing calls this directly
no test coverage detected