gene-bordegaray commented on code in PR #23184: URL: https://github.com/apache/datafusion/pull/23184#discussion_r3535661635
########## 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 think we can flip the model: have operators opt in rather than the the satisfaction logic check operators to allow range. That would clean some of this up. Let me try -- 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]
