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

Function executeSubQuery

src/Interpreters/executeSubQuery.cpp:133–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void executeSubQuery(const String & query, ContextMutablePtr query_context, std::function<void(Block &)> proc_block, bool internal)
134{
135 modifyQueryContext(query_context, internal);
136
137 std::exception_ptr exception;
138 auto thread = ThreadFromGlobalPool([query_context = std::move(query_context), &query, proc_block, internal, &exception]() {
139 try
140 {
141 CurrentThread::QueryScope query_scope{query_context};
142 {
143 auto block_io = executeQuery(query, query_context, internal);
144
145 auto input_stream = block_io.getInputStream();
146 input_stream->readPrefix();
147 while (auto block = input_stream->read())
148 {
149 if (block.rows() == 0)
150 continue;
151 proc_block(block);
152 }
153 input_stream->readSuffix();
154
155 block_io.onFinish();
156 }
157 }
158 catch (...)
159 {
160 exception = constructException(query_context);
161 }
162 });
163 thread.join();
164
165 if (exception)
166 std::rethrow_exception(exception);
167}
168
169Block executeSubPipelineWithOneRow(
170 const ASTPtr & query, ContextMutablePtr query_context, std::function<void(InterpreterSelectQueryUseOptimizer &)> pre_execute, bool tolerate_multi_rows)

Callers 3

batchReadTaskLogFunction · 0.85
collectThirdStepMethod · 0.85

Calls 11

modifyQueryContextFunction · 0.85
constructExceptionFunction · 0.85
getInputStreamMethod · 0.80
executeQueryFunction · 0.70
readPrefixMethod · 0.45
readMethod · 0.45
rowsMethod · 0.45
readSuffixMethod · 0.45
onFinishMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected