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

Function adoptBlock

src/Storages/Distributed/DistributedBlockOutputStream.cpp:85–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85static Block adoptBlock(const Block & header, const Block & block, Poco::Logger * log)
86{
87 if (blocksHaveEqualStructure(header, block))
88 return block;
89
90 LOG_WARNING(log,
91 "Structure does not match (remote: {}, local: {}), implicit conversion will be done.",
92 header.dumpStructure(), block.dumpStructure());
93
94 ConvertingBlockInputStream convert(
95 std::make_shared<OneBlockInputStream>(block),
96 header,
97 ConvertingBlockInputStream::MatchColumnsMode::Name);
98 return convert.read();
99}
100
101
102static void writeBlockConvert(const BlockOutputStreamPtr & out, const Block & block, size_t repeats, Poco::Logger * log)

Callers 2

writeBlockConvertFunction · 0.85
runWritingJobMethod · 0.85

Calls 3

blocksHaveEqualStructureFunction · 0.85
dumpStructureMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected