Apache DataFusion SQL Query Engine
Add more doc to InputOrderMode (#9255)
Liang-Chi Hsiehd4357ec42b77
diff --git a/datafusion/physical-plan/src/ordering.rs b/datafusion/physical-plan/src/ordering.rsindex 047f89eef1..8b596b9cb2 100644--- a/datafusion/physical-plan/src/ordering.rs+++ b/datafusion/physical-plan/src/ordering.rs@@ -28,11 +28,14 @@/// - A `PARTITION BY a, b` or a `PARTITION BY b, a` can use `Sorted` mode.////// ## Aggregations-/// - A `GROUP BY b` clause can use `Linear` mode.-/// - A `GROUP BY a, c` or a `GROUP BY BY c, a` can use-/// `PartiallySorted([0])` or `PartiallySorted([1])` modes, respectively.+/// - A `GROUP BY b` clause can use `Linear` mode, as the only one permutation `[b]`+/// cannot satisfy the existing ordering.+/// - A `GROUP BY a, c` or a `GROUP BY c, a` can use+/// `PartiallySorted([0])` or `PartiallySorted([1])` modes, respectively, as+/// the permutation `[a]` satisfies the existing ordering./// (The vector stores the index of `a` in the respective PARTITION BY expression.)-/// - A `GROUP BY a, b` or a `GROUP BY b, a` can use `Sorted` mode.+/// - A `GROUP BY a, b` or a `GROUP BY b, a` can use `Sorted` mode, as the+/// full permutation `[a, b]` satisfies the existing ordering.////// Note these are the same examples as above, but with `GROUP BY` instead of/// `PARTITION BY` to make the examples easier to read.diff --git a/datafusion/physical-plan/src/windows/mod.rs b/datafusion/physical-plan/src/windows/mod.rsindex 01818405b8..693d20e90a 100644--- a/datafusion/physical-plan/src/windows/mod.rs+++ b/datafusion/physical-plan/src/windows/mod.rs@@ -329,11 +329,11 @@ pub(crate) fn calc_requirements<(!sort_reqs.is_empty()).then_some(sort_reqs)}-/// This function calculates the indices such that when partition by expressions reordered with this indices+/// This function calculates the indices such that when partition by expressions reordered with the indices/// resulting expressions define a preset for existing ordering.-// For instance, if input is ordered by a, b, c and PARTITION BY b, a is used-// This vector will be [1, 0]. It means that when we iterate b,a columns with the order [1, 0]-// resulting vector (a, b) is a preset of the existing ordering (a, b, c).+/// For instance, if input is ordered by a, b, c and PARTITION BY b, a is used,+/// this vector will be [1, 0]. It means that when we iterate b, a columns with the order [1, 0]+/// resulting vector (a, b) is a preset of the existing ordering (a, b, c).pub(crate) fn get_ordered_partition_by_indices(partition_by_exprs: &[Arc<dyn PhysicalExpr>],input: &Arc<dyn ExecutionPlan>,