mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-03 03:47:42 +00:00
0b270bf0cc
Signed-off-by: junxiang Mu <1948535941@qq.com>
23 lines
612 B
Rust
23 lines
612 B
Rust
use std::sync::Arc;
|
|
|
|
use api::query::scheduler::{ExecutionResults, Scheduler};
|
|
use async_trait::async_trait;
|
|
use datafusion::error::DataFusionError;
|
|
use datafusion::execution::context::TaskContext;
|
|
use datafusion::physical_plan::{execute_stream, ExecutionPlan};
|
|
|
|
pub struct LocalScheduler {}
|
|
|
|
#[async_trait]
|
|
impl Scheduler for LocalScheduler {
|
|
async fn schedule(
|
|
&self,
|
|
plan: Arc<dyn ExecutionPlan>,
|
|
context: Arc<TaskContext>,
|
|
) -> Result<ExecutionResults, DataFusionError> {
|
|
let stream = execute_stream(plan, context)?;
|
|
|
|
Ok(ExecutionResults::new(stream))
|
|
}
|
|
}
|