| 308 | } |
| 309 | |
| 310 | Pipe createRemoteSourcePipe( |
| 311 | RemoteQueryExecutorPtr query_executor, |
| 312 | bool add_aggregation_info, |
| 313 | bool add_totals, |
| 314 | bool add_extremes, |
| 315 | bool async_read, |
| 316 | bool async_query_sending, |
| 317 | size_t parallel_marshalling_threads) |
| 318 | { |
| 319 | chassert(parallel_marshalling_threads); |
| 320 | |
| 321 | Pipe pipe(std::make_shared<RemoteSource>(query_executor, add_aggregation_info, async_read, async_query_sending)); |
| 322 | pipe.addSimpleTransform([&](const SharedHeader & header) { return std::make_shared<AddSequenceNumber>(header); }); |
| 323 | |
| 324 | if (add_totals) |
| 325 | pipe.addTotalsSource(std::make_shared<RemoteTotalsSource>(query_executor)); |
| 326 | |
| 327 | if (add_extremes) |
| 328 | pipe.addExtremesSource(std::make_shared<RemoteExtremesSource>(query_executor)); |
| 329 | |
| 330 | pipe.resize(parallel_marshalling_threads); |
| 331 | pipe.addSimpleTransform([&](const SharedHeader & header) { return std::make_shared<UnmarshallBlocksTransform>(header); }); |
| 332 | pipe.addTransform(std::make_shared<SortChunksBySequenceNumber>(pipe.getHeader(), parallel_marshalling_threads)); |
| 333 | |
| 334 | return pipe; |
| 335 | } |
| 336 | |
| 337 | } |
no test coverage detected