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

Method deserializeText

src/DataTypes/Serializations/SerializationTuple.cpp:126–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void SerializationTuple::deserializeText(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
127{
128 const size_t size = elems.size();
129 assertChar('(', istr);
130
131 addElementSafe(elems.size(), column, [&]
132 {
133 for (const auto i : collections::range(0, size))
134 {
135 skipWhitespaceIfAny(istr);
136 if (i != 0)
137 {
138 assertChar(',', istr);
139 skipWhitespaceIfAny(istr);
140 }
141 elems[i]->deserializeTextQuoted(extractElementColumn(column, i), istr, settings);
142 }
143 });
144
145 // Special format for one element tuple (1,)
146 if (1 == elems.size())
147 {
148 skipWhitespaceIfAny(istr);
149 // Allow both (1) and (1,)
150 checkChar(',', istr);
151 }
152 skipWhitespaceIfAny(istr);
153 assertChar(')', istr);
154}
155
156void SerializationTuple::serializeTextJSON(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const
157{

Callers

nothing calls this directly

Calls 7

assertCharFunction · 0.85
rangeFunction · 0.85
skipWhitespaceIfAnyFunction · 0.85
checkCharFunction · 0.85
addElementSafeFunction · 0.70
sizeMethod · 0.45
deserializeTextQuotedMethod · 0.45

Tested by

no test coverage detected