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

[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #5607: [FOLLOWUP] eliminate the duplicated sort keys in Order By clause

jackwener commented on code in PR #5607:
URL: https://github.com/apache/arrow-datafusion/pull/5607#discussion_r1136553437


##########
datafusion/optimizer/src/eliminate_duplicated_expr.rs:
##########
@@ -100,4 +115,23 @@ mod tests {
         \n    TableScan: test";
         assert_optimized_plan_eq(&plan, expected)
     }
+
+    #[test]
+    fn eliminate_sort_exprs_with_options() -> Result<()> {
+        let table_scan = test_table_scan().unwrap();
+        let sort_exprs = vec![
+            Expr::Sort(ExprSort::new(Box::new(col("a")), true, true)),
+            Expr::Sort(ExprSort::new(Box::new(col("b")), true, false)),
+            Expr::Sort(ExprSort::new(Box::new(col("a")), false, false)),
+            Expr::Sort(ExprSort::new(Box::new(col("b")), false, true)),

Review Comment:
   ```suggestion
               col("a").sort(true, true),
               col("b").sort(true, false),
               col("a").sort(false, false),
               col("b").sort(false, true),
   ```



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