gene-bordegaray commented on code in PR #23239:
URL: https://github.com/apache/datafusion/pull/23239#discussion_r3505676156


##########
datafusion/core/tests/physical_optimizer/enforce_distribution.rs:
##########
@@ -700,6 +748,201 @@ impl TestConfig {
     }
 }
 
+#[test]
+fn range_aggregate_keeps_range_partitioning_at_subset_threshold() -> 
Result<()> {
+    let input = parquet_exec_with_output_partitioning(range_partitioning(
+        "a",
+        [10, 20, 30],
+        SortOptions::default(),
+    )?);
+    let aggregate =
+        aggregate_exec_with_alias(input, vec![("a".to_string(), 
"a".to_string())]);
+
+    let plan = TestConfig::default()
+        .with_query_execution_partitions(4)
+        .to_plan(aggregate, &DISTRIB_DISTRIB_SORT);
+
+    assert_plan!(
+        plan,
+        @r"
+    AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[]
+      AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[]
+        DataSourceExec: file_groups={4 groups: [[p0], [p1], [p2], [p3]]}, 
projection=[a, b, c, d, e], output_partitioning=Range([a@0 ASC], [(10), (20), 
(30)], 4), file_type=parquet

Review Comment:
   ah ok ya that makes sense. I think a nice split corresponding with this 
logic would be something like:
   
   **Unit**
   - 2 demo tests as smoke tests to catch errors for range specifically in this 
file
   - The grouping set test as this would be hard to repro. For context this is 
needed and was introduced in #19853
   
   **SLT**
   - set of more end to end nehaavior covering: basic satisfaction, negative on 
satisfaction, subset, file preservation



-- 
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]

Reply via email to