| 84 | |
| 85 | |
| 86 | void SerializationSketch::serializeBinaryBulk(const IColumn & column, WriteBuffer & ostr, size_t offset, size_t limit) const |
| 87 | { |
| 88 | const ColumnSketchBinary & column_string = typeid_cast<const ColumnSketchBinary &>(column); |
| 89 | const ColumnSketchBinary::Chars & data = column_string.getChars(); |
| 90 | const ColumnSketchBinary::Offsets & offsets = column_string.getOffsets(); |
| 91 | |
| 92 | size_t size = column.size(); |
| 93 | if (!size) |
| 94 | return; |
| 95 | |
| 96 | size_t end = limit && offset + limit < size |
| 97 | ? offset + limit |
| 98 | : size; |
| 99 | |
| 100 | if (offset == 0) |
| 101 | { |
| 102 | UInt64 str_size = offsets[0] - 1; |
| 103 | writeVarUInt(str_size, ostr); |
| 104 | ostr.write(reinterpret_cast<const char *>(data.data()), str_size); |
| 105 | |
| 106 | ++offset; |
| 107 | } |
| 108 | |
| 109 | for (size_t i = offset; i < end; ++i) |
| 110 | { |
| 111 | UInt64 str_size = offsets[i] - offsets[i - 1] - 1; |
| 112 | writeVarUInt(str_size, ostr); |
| 113 | ostr.write(reinterpret_cast<const char *>(&data[offsets[i - 1]]), str_size); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | |
| 118 | template <int UNROLL_TIMES> |
nothing calls this directly
no test coverage detected