| 124 | } |
| 125 | |
| 126 | void 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 | |
| 156 | void SerializationTuple::serializeTextJSON(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const |
| 157 | { |
nothing calls this directly
no test coverage detected