MCPcopy Create free account
hub / github.com/ByConity/ByConity / serializeBinaryBulk

Method serializeBinaryBulk

src/DataTypes/Serializations/SerializationString.cpp:136–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134
135
136void 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
168template <int UNROLL_TIMES>

Callers

nothing calls this directly

Calls 5

writeVarUIntFunction · 0.85
getOffsetsMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected