Skip to content

Commit 198d485

Browse files
committed
refactor(interpreter): try fix standalone test
1 parent 44ae413 commit 198d485

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/query/service/src/interpreters/interpreter.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,20 @@ pub trait Interpreter: Sync + Send {
4545

4646
/// The core of the databend processor which will execute the logical plan and get the DataBlock
4747
async fn execute(&self, ctx: Arc<QueryContext>) -> Result<SendableDataBlockStream> {
48-
let build_res = self.execute2().await?;
48+
let mut build_res = self.execute2().await?;
49+
50+
if build_res.main_pipeline.pipes.is_empty() {
51+
return Ok(Box::pin(DataBlockStream::create(
52+
self.schema(),
53+
None,
54+
vec![],
55+
)));
56+
}
4957

5058
let settings = ctx.get_settings();
5159
let query_need_abort = ctx.query_need_abort();
5260
let executor_settings = ExecutorSettings::try_create(&settings)?;
61+
build_res.set_max_threads(settings.get_max_threads()? as usize);
5362

5463
if build_res.main_pipeline.is_complete_pipeline()? {
5564
let mut pipelines = build_res.sources_pipelines;

0 commit comments

Comments
 (0)