tustvold commented on code in PR #2226: URL: https://github.com/apache/arrow-datafusion/pull/2226#discussion_r856293325
########## datafusion/scheduler/src/query.rs: ########## @@ -0,0 +1,276 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::sync::Arc; + +use datafusion::error::Result; +use datafusion::execution::context::TaskContext; +use datafusion::physical_plan::coalesce_partitions::CoalescePartitionsExec; +use datafusion::physical_plan::repartition::RepartitionExec; +use datafusion::physical_plan::{ExecutionPlan, Partitioning}; + +use crate::pipeline::{ + execution::ExecutionPipeline, repartition::RepartitionPipeline, Pipeline, +}; + +/// Identifies the [`Pipeline`] within the [`Query`] to route output to +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct OutputLink { + /// The index of the [`Pipeline`] in [`Query`] to route output to + pub pipeline: usize, + + /// The child of the [`Pipeline`] to route output to + pub child: usize, +} + +/// Combines a [`Pipeline`] with an [`OutputLink`] identifying where to send its output +#[derive(Debug)] +pub struct RoutablePipeline { + /// The pipeline that produces data + pub pipeline: Box<dyn Pipeline>, + + /// Where to send output the output of `pipeline` + /// + /// If `None`, the output should be sent to the query output + pub output: Option<OutputLink>, +} + +/// [`Query`] is the scheduler's representation of the [`ExecutionPlan`] passed to +/// [`super::Scheduler::schedule`]. It combines the list of [Pipeline`] with the information +/// necessary to route output from one stage to the next +#[derive(Debug)] +pub struct Query { Review Comment: I like PipelinePlan -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
