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

Method work

src/Processors/Sources/SourceFromInputStream.cpp:91–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void SourceFromInputStream::work()
92{
93 if (!is_generating_finished)
94 {
95 try
96 {
97 ISource::work();
98 }
99 catch (...)
100 {
101 /// Won't read suffix in case of exception.
102 is_stream_finished = true;
103 throw;
104 }
105
106 return;
107 }
108
109 if (is_stream_finished)
110 return;
111
112 /// Don't cancel for RemoteBlockInputStream (otherwise readSuffix can stack)
113 if (!typeid_cast<const RemoteBlockInputStream *>(stream.get()))
114 stream->cancel(false);
115
116 if (rows_before_limit)
117 {
118 const auto & info = stream->getProfileInfo();
119 if (info.hasAppliedLimit())
120 rows_before_limit->add(info.getRowsBeforeLimit());
121 }
122
123 stream->readSuffix();
124
125 if (auto totals_block = stream->getTotals())
126 {
127 totals.setColumns(totals_block.getColumns(), 1);
128 has_totals = true;
129 }
130
131 is_stream_finished = true;
132}
133
134Chunk SourceFromInputStream::generate()
135{

Callers

nothing calls this directly

Calls 9

getRowsBeforeLimitMethod · 0.80
getMethod · 0.45
cancelMethod · 0.45
hasAppliedLimitMethod · 0.45
addMethod · 0.45
readSuffixMethod · 0.45
getTotalsMethod · 0.45
setColumnsMethod · 0.45
getColumnsMethod · 0.45

Tested by

no test coverage detected