blaginin commented on code in PR #27439:
URL: https://github.com/apache/datafusion/pull/27439#discussion_r4591176284


##########
datafusion/core/tests/physical_optimizer/enforce_sorting_monotonicity.rs:
##########
@@ -666,14 +666,10 @@ fn test_window_partial_constant_and_set_monotonicity_17() 
{
         ],
     }.run(),
         @ r#"
-    Input Plan:
+    Input / Optimized Plan:
     SortExec: expr=[max@2 DESC, nullable_col@0 ASC NULLS LAST], 
preserve_partitioning=[false]
       WindowAggExec: wdw=[max: Ok(Field { name: "max", data_type: Int32, 
nullable: true }), frame: WindowFrame { units: Rows, start_bound: CurrentRow, 
end_bound: Following(UInt64(NULL)), is_causal: false }]
         DataSourceExec: file_groups={1 group: [[x]]}, 
projection=[nullable_col, non_nullable_col], output_ordering=[nullable_col@0 
ASC NULLS LAST], file_type=parquet
-
-    Optimized Plan:
-    WindowAggExec: wdw=[max: Ok(Field { name: "max", data_type: Int32, 
nullable: true }), frame: WindowFrame { units: Rows, start_bound: CurrentRow, 
end_bound: Following(UInt64(NULL)), is_causal: false }]
-      DataSourceExec: file_groups={1 group: [[x]]}, projection=[nullable_col, 
non_nullable_col], output_ordering=[nullable_col@0 ASC NULLS LAST], 
file_type=parquet

Review Comment:
   i don't think that was correct in general case, e.g. 
   
   | x    | MAX(x) | MIN(x) |
   |------|--------|--------|
   | 1    | 2      | 1      |
   | 2    | 2      | 2      |
   | NULL | NULL   | NULL   |
   
   if you have `ORDER BY MAX(x) DESC NULLS FIRST` the NULL row would be in the 
wrong place
   



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