| 218 | |
| 219 | |
| 220 | QueryPipeline 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 | |
| 244 | void registerDictionarySourceXDBC(DictionarySourceFactory & factory); |
| 245 | void registerDictionarySourceXDBC(DictionarySourceFactory & factory) |
nothing calls this directly
no test coverage detected