alamb commented on code in PR #7129:
URL: https://github.com/apache/arrow-datafusion/pull/7129#discussion_r1280437195


##########
datafusion/core/src/physical_plan/aggregates/mod.rs:
##########
@@ -1370,6 +1372,54 @@ mod tests {
         )
     }
 
+    /// some mock data to aggregates
+    fn some_data_v2() -> (Arc<Schema>, Vec<RecordBatch>) {
+        // define a schema.
+        let schema = Arc::new(Schema::new(vec![
+            Field::new("a", DataType::UInt32, false),
+            Field::new("b", DataType::Float64, false),
+        ]));
+
+        // define data.

Review Comment:
   ```suggestion
           // Data is constructed such that first and last value result is at 
2nd and 3rd partition. 
           // With this construction, we guarantee that expected result 
received is not accident, 
           // but merging works properly (It doesn't depend on the data 
insertion order).
   ```



##########
datafusion/core/tests/sqllogictests/test_files/groupby.slt:
##########
@@ -1960,21 +1960,20 @@ SortPreservingMergeExec: [col0@0 ASC NULLS LAST]
 --SortExec: expr=[col0@0 ASC NULLS LAST]
 ----ProjectionExec: expr=[col0@0 as col0, LAST_VALUE(r.col1) ORDER BY [r.col0 
ASC NULLS LAST]@3 as last_col1]
 ------AggregateExec: mode=FinalPartitioned, gby=[col0@0 as col0, col1@1 as 
col1, col2@2 as col2], aggr=[LAST_VALUE(r.col1)]
---------SortExec: expr=[col0@3 ASC NULLS LAST]

Review Comment:
   I it makes sense that there is nothing inserted between the two aggregate 
phases given the aggregates themselves track the sortedness 
   



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

Reply via email to