gabotechs commented on code in PR #23184: URL: https://github.com/apache/datafusion/pull/23184#discussion_r3535060553
########## datafusion/physical-plan/src/distribution_requirements.rs: ########## @@ -0,0 +1,503 @@ +// 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. + +//! Input distribution requirements for physical execution plans. + +use std::sync::Arc; + +use datafusion_common::{Result, internal_err}; +use datafusion_physical_expr::{ + Distribution, EquivalenceProperties, Partitioning, PhysicalExpr, RangePartitioning, + physical_exprs_equal, +}; + +use crate::execution_plan::{ExecutionPlan, ExecutionPlanProperties, InvariantLevel}; + +/// Distribution requirements for an [`ExecutionPlan`]'s inputs. +#[non_exhaustive] +#[derive(Debug, Clone)] +pub struct RequiredInputDistributions { + /// Distribution requirement for each child, by child index. + per_child: Vec<Distribution>, + /// Satisfaction policy for each child, by child index. + /// + /// TODO: remove this field once [`Partitioning::Range`] generally + /// satisfies [`Distribution::KeyPartitioned`] through + /// [`Partitioning::satisfaction`]. See + /// <https://github.com/apache/datafusion/issues/23266>. + per_child_satisfaction: Vec<InputDistributionSatisfaction>, + /// Cross-child distribution relationships required by the plan. + relationships: Vec<InputDistributionRelationship>, Review Comment: Is there any scenario where this Vec would have a length greater than 1? ########## datafusion/physical-plan/src/distribution_requirements.rs: ########## @@ -0,0 +1,503 @@ +// 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. + +//! Input distribution requirements for physical execution plans. + +use std::sync::Arc; + +use datafusion_common::{Result, internal_err}; +use datafusion_physical_expr::{ + Distribution, EquivalenceProperties, Partitioning, PhysicalExpr, RangePartitioning, + physical_exprs_equal, +}; + +use crate::execution_plan::{ExecutionPlan, ExecutionPlanProperties, InvariantLevel}; + +/// Distribution requirements for an [`ExecutionPlan`]'s inputs. +#[non_exhaustive] +#[derive(Debug, Clone)] +pub struct RequiredInputDistributions { + /// Distribution requirement for each child, by child index. + per_child: Vec<Distribution>, + /// Satisfaction policy for each child, by child index. + /// + /// TODO: remove this field once [`Partitioning::Range`] generally + /// satisfies [`Distribution::KeyPartitioned`] through + /// [`Partitioning::satisfaction`]. See + /// <https://github.com/apache/datafusion/issues/23266>. + per_child_satisfaction: Vec<InputDistributionSatisfaction>, + /// Cross-child distribution relationships required by the plan. Review Comment: I see there's a big amount of code shipped in this PR just because of the fact that is happening before https://github.com/apache/datafusion/issues/23266. How about shipping https://github.com/apache/datafusion/issues/23266 first? would that avoid introducing all this intermediate toil? -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
