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

Method read

src/QueryPipeline/RemoteQueryExecutor.cpp:536–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534
535
536RemoteQueryExecutor::ReadResult RemoteQueryExecutor::read()
537{
538 if (!sent_query)
539 {
540 sendQuery();
541
542 /// `connections` stays null if sendQuery() was cancelled before sending,
543 /// so guard the dereference below (as every other use of it does).
544 {
545 LockAndBlocker lock(was_cancelled_mutex);
546 if (was_cancelled)
547 return ReadResult(Block());
548 }
549
550 if (context->getSettingsRef()[Setting::skip_unavailable_shards] && (0 == connections->size()))
551 return ReadResult(Block());
552 }
553
554 while (true)
555 {
556 LockAndBlocker lock(was_cancelled_mutex);
557 if (was_cancelled)
558 return ReadResult(Block());
559
560 auto packet = connections->receivePacket();
561 auto anything = processPacket(std::move(packet));
562
563 if (anything.getType() == ReadResult::Type::Data || anything.getType() == ReadResult::Type::ParallelReplicasToken)
564 return anything;
565 }
566}
567
568RemoteQueryExecutor::ReadResult RemoteQueryExecutor::readAsync()
569{

Callers 3

readAsyncMethod · 0.45
sendExternalTablesMethod · 0.45

Calls 5

ReadResultClass · 0.70
BlockClass · 0.70
sizeMethod · 0.45
receivePacketMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected