You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/04/05 20:02:36 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #5874: [MINOR]: Refactor to increase readability

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


##########
datafusion/physical-expr/src/window/window_expr.rs:
##########
@@ -281,7 +261,7 @@ pub fn reverse_order_bys(order_bys: &[PhysicalSortExpr]) -> Vec<PhysicalSortExpr
         .iter()
         .map(|e| PhysicalSortExpr {
             expr: e.expr.clone(),
-            options: reverse_sort_options(e.options),
+            options: !e.options,

Review Comment:
   ❤️ 



##########
datafusion/core/src/physical_plan/windows/bounded_window_agg_exec.rs:
##########
@@ -628,23 +625,6 @@ impl SortedPartitionByBoundedWindowStream {
             .map(|e| e.evaluate_to_sort_column(batch))
             .collect::<Result<Vec<_>>>()
     }
-
-    /// evaluate the partition points given the sort columns; if the sort columns are

Review Comment:
   it is nice to avoid this repetition 👍 



##########
datafusion/common/src/utils.rs:
##########
@@ -162,6 +163,23 @@ where
     Ok(low)
 }
 
+/// This function finds the partition points according to `partition_columns`.
+/// If there are no sort columns, then the result will be a single element
+/// vector containing one partition range spanning all data.
+pub fn evaluate_partition_points(

Review Comment:
   I agree `evaluate_partition_ranges` sounds more specific. 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org