| 134 | |
| 135 | |
| 136 | void SerializationString::serializeBinaryBulk(const IColumn & column, WriteBuffer & ostr, size_t offset, size_t limit) const |
| 137 | { |
| 138 | const ColumnString & column_string = typeid_cast<const ColumnString &>(column); |
| 139 | const ColumnString::Chars & data = column_string.getChars(); |
| 140 | const ColumnString::Offsets & offsets = column_string.getOffsets(); |
| 141 | |
| 142 | size_t size = column.size(); |
| 143 | if (!size) |
| 144 | return; |
| 145 | |
| 146 | size_t end = limit && offset + limit < size |
| 147 | ? offset + limit |
| 148 | : size; |
| 149 | |
| 150 | if (offset == 0) |
| 151 | { |
| 152 | UInt64 str_size = offsets[0] - 1; |
| 153 | writeVarUInt(str_size, ostr); |
| 154 | ostr.write(reinterpret_cast<const char *>(data.data()), str_size); |
| 155 | |
| 156 | ++offset; |
| 157 | } |
| 158 | |
| 159 | for (size_t i = offset; i < end; ++i) |
| 160 | { |
| 161 | UInt64 str_size = offsets[i] - offsets[i - 1] - 1; |
| 162 | writeVarUInt(str_size, ostr); |
| 163 | ostr.write(reinterpret_cast<const char *>(&data[offsets[i - 1]]), str_size); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | |
| 168 | template <int UNROLL_TIMES> |
nothing calls this directly
no test coverage detected