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

Method writePrefix

src/Processors/Formats/Impl/MySQLOutputFormat.cpp:56–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void MySQLOutputFormat::writePrefix()
57{
58 const auto & header = getPort(PortKind::Main).getHeader();
59
60 if (header.columns())
61 {
62 packet_endpoint->sendPacket(LengthEncodedNumber(header.columns()), false);
63
64 for (size_t i = 0; i < header.columns(); ++i)
65 {
66 const auto & column_name = header.getColumnsWithTypeAndName()[i].name;
67 packet_endpoint->sendPacket(getColumnDefinition(column_name, data_types[i]), false);
68 }
69
70 if (!(client_capabilities & Capability::CLIENT_DEPRECATE_EOF) && !use_binary_result_set)
71 {
72 packet_endpoint->sendPacket(EOFPacket(0, 0), false);
73 }
74 }
75}
76
77void MySQLOutputFormat::consume(Chunk chunk)
78{

Callers 2

finalizeImplMethod · 0.45

Calls 6

LengthEncodedNumberClass · 0.85
getColumnDefinitionFunction · 0.85
EOFPacketClass · 0.85
columnsMethod · 0.80
sendPacketMethod · 0.80
getHeaderMethod · 0.45

Tested by

no test coverage detected