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

Method serializeBinaryBulk

src/DataTypes/Serializations/SerializationSketch.cpp:86–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85
86void 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
118template <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