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

Method loadFromQuery

src/Dictionaries/XDBCDictionarySource.cpp:220–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218
219
220QueryPipeline XDBCDictionarySource::loadFromQuery(const Poco::URI & uri, const Block & required_sample_block, const std::string & query) const
221{
222 bridge_helper->startBridgeSync();
223
224 auto write_body_callback = [required_sample_block, query](std::ostream & os)
225 {
226 os << "sample_block=" << escapeForFileName(required_sample_block.getNamesAndTypesList().toString());
227 os << "&";
228 os << "query=" << escapeForFileName(query);
229 };
230
231 auto buf = BuilderRWBufferFromHTTP(uri)
232 .withConnectionGroup(HTTPConnectionGroupType::STORAGE)
233 .withMethod(Poco::Net::HTTPRequest::HTTP_POST)
234 .withTimeouts(timeouts)
235 .withOutCallback(std::move(write_body_callback))
236 .create(credentials);
237
238 auto format = getContext()->getInputFormat(IXDBCBridgeHelper::DEFAULT_FORMAT, *buf, required_sample_block, max_block_size);
239 format->addBuffer(std::move(buf));
240
241 return QueryPipeline(std::move(format));
242}
243
244void registerDictionarySourceXDBC(DictionarySourceFactory & factory);
245void registerDictionarySourceXDBC(DictionarySourceFactory & factory)

Callers

nothing calls this directly

Calls 10

escapeForFileNameFunction · 0.85
startBridgeSyncMethod · 0.80
QueryPipelineClass · 0.70
getContextFunction · 0.50
toStringMethod · 0.45
getNamesAndTypesListMethod · 0.45
createMethod · 0.45
getInputFormatMethod · 0.45
addBufferMethod · 0.45

Tested by

no test coverage detected