MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / decodeField

Function decodeField

src/Common/FieldBinaryEncoding.cpp:285–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285Field decodeField(ReadBuffer & buf)
286{
287 UInt8 type = 0;
288 readBinary(type, buf);
289 switch (FieldBinaryTypeIndex(type))
290 {
291 case FieldBinaryTypeIndex::Null:
292 return Null();
293 case FieldBinaryTypeIndex::PositiveInfinity:
294 return POSITIVE_INFINITY;
295 case FieldBinaryTypeIndex::NegativeInfinity:
296 return NEGATIVE_INFINITY;
297 case FieldBinaryTypeIndex::Int64:
298 {
299 Int64 value = 0;
300 readVarInt(value, buf);
301 return value;
302 }
303 case FieldBinaryTypeIndex::UInt64:
304 {
305 UInt64 value = 0;
306 readVarUInt(value, buf);
307 return value;
308 }
309 case FieldBinaryTypeIndex::Int128:
310 return decodeBigInteger<Int128>(buf);
311 case FieldBinaryTypeIndex::UInt128:
312 return decodeBigInteger<UInt128>(buf);
313 case FieldBinaryTypeIndex::Int256:
314 return decodeBigInteger<Int256>(buf);
315 case FieldBinaryTypeIndex::UInt256:
316 return decodeBigInteger<UInt256>(buf);
317 case FieldBinaryTypeIndex::Float64:
318 return decodeValueLittleEndian<Float64>(buf);
319 case FieldBinaryTypeIndex::Decimal32:
320 return decodeDecimal<Decimal32>(buf);
321 case FieldBinaryTypeIndex::Decimal64:
322 return decodeDecimal<Decimal64>(buf);
323 case FieldBinaryTypeIndex::Decimal128:
324 return decodeDecimal<Decimal128>(buf);
325 case FieldBinaryTypeIndex::Decimal256:
326 return decodeDecimal<Decimal256>(buf);
327 case FieldBinaryTypeIndex::String:
328 {
329 String value;
330 readStringBinary(value, buf);
331 return value;
332 }
333 case FieldBinaryTypeIndex::UUID:
334 return decodeValueLittleEndian<UUID>(buf);
335 case FieldBinaryTypeIndex::IPv4:
336 return decodeValueLittleEndian<IPv4>(buf);
337 case FieldBinaryTypeIndex::IPv6:
338 return decodeValueLittleEndian<IPv6>(buf);
339 case FieldBinaryTypeIndex::Bool:
340 {
341 bool value = false;
342 readBinary(value, buf);

Callers 3

decodeArrayLikeFieldFunction · 0.85
checkFunction · 0.85
decodeAggregateFunctionFunction · 0.85

Calls 6

readStringBinaryFunction · 0.85
ExceptionClass · 0.70
readBinaryFunction · 0.50
NullClass · 0.50
push_backMethod · 0.45

Tested by 1

checkFunction · 0.68