Dandandan commented on code in PR #21211:
URL: https://github.com/apache/datafusion/pull/21211#discussion_r3004192851


##########
datafusion/physical-expr-common/src/metrics/baseline.rs:
##########
@@ -178,6 +237,37 @@ impl Drop for BaselineMetrics {
     }
 }
 
+/// See [`BaselineMetrics::output_rows_skew_metric`] for the algorithm.
+fn output_rows_skew_score(output_rows: &[u128]) -> Option<f64> {
+    if output_rows.is_empty() {
+        return None;
+    }
+
+    let partition_count = output_rows.len();
+    if partition_count == 1 {
+        return Some(0.0);
+    }
+
+    let output_rows = output_rows

Review Comment:
   this allocation can be prevented by doing the cast/sum directly



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