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

Method sendData

src/Client/Connection.cpp:1089–1118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1087
1088
1089void Connection::sendData(const Block & block, const String & name, bool scalar)
1090{
1091 if (!block_out)
1092 {
1093 if (compression == Protocol::Compression::Enable)
1094 maybe_compressed_out = std::make_unique<CompressedWriteBuffer>(*out, compression_codec);
1095 else
1096 maybe_compressed_out = out;
1097
1098 block_out = std::make_unique<NativeWriter>(*maybe_compressed_out, server_revision, std::make_shared<const Block>(block.cloneEmpty()), format_settings);
1099 }
1100
1101 if (scalar)
1102 writeVarUInt(Protocol::Client::Scalar, *out);
1103 else
1104 writeVarUInt(Protocol::Client::Data, *out);
1105 writeStringBinary(name, *out);
1106
1107 size_t prev_bytes = out->count();
1108
1109 block_out->write(block);
1110 if (maybe_compressed_out != out)
1111 maybe_compressed_out->next();
1112 if (block.empty())
1113 out->finishChunk();
1114 out->next();
1115
1116 if (throttler)
1117 throttler->throttle(out->count() - prev_bytes);
1118}
1119
1120void Connection::sendClusterFunctionReadTaskResponse(const ClusterFunctionReadTaskResponse & response)
1121{

Callers 1

consumeMethod · 0.45

Calls 9

writeVarUIntFunction · 0.85
writeStringBinaryFunction · 0.85
finishChunkMethod · 0.80
cloneEmptyMethod · 0.45
countMethod · 0.45
writeMethod · 0.45
nextMethod · 0.45
emptyMethod · 0.45
throttleMethod · 0.45

Tested by

no test coverage detected