Registry Mirror
搜索
Skip to content
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Files
Expand file tree
master
Breadcrumbs
fuse-query
/
src
/
executors
/
executor_select.rs
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
43 lines (37 loc) · 1.09 KB
master
Breadcrumbs
fuse-query
/
src
/
executors
/
executor_select.rs
Copy path
Top
File metadata and controls
Code
Blame
43 lines (37 loc) · 1.09 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2020 The FuseQuery Authors.
//
// Code is licensed under AGPL License, Version 3.0.
use async_trait::async_trait;
use std::sync::Arc;
use crate::contexts::FuseQueryContextRef;
use crate::datastreams::SendableDataBlockStream;
use crate::error::FuseQueryResult;
use crate::executors::IExecutor;
use crate::optimizers::Optimizer;
use crate::planners::SelectPlan;
use crate::processors::PipelineBuilder;
pub struct SelectExecutor {
ctx: FuseQueryContextRef,
select: SelectPlan,
}
impl SelectExecutor {
pub fn try_create(
ctx: FuseQueryContextRef,
select: SelectPlan,
) -> FuseQueryResult<Arc<dyn IExecutor>> {
Ok(Arc::new(SelectExecutor { ctx, select }))
}
}
#[async_trait]
impl IExecutor for SelectExecutor {
fn name(&self) -> &str {
"SelectExecutor"
}
async fn execute(&self) -> FuseQueryResult<SendableDataBlockStream> {
let plan = Optimizer::create(self.ctx.clone()).optimize(&self.select.plan)?;
PipelineBuilder::create(self.ctx.clone(), plan)
.build()?
.execute()
.await
}
}
You can’t perform that action at this time.