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

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

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


##########
datafusion/optimizer/src/eliminate_duplicated_expr.rs:
##########
@@ -41,15 +42,28 @@ impl OptimizerRule for EliminateDuplicatedExpr {
     ) -> Result<Option<LogicalPlan>> {
         match plan {
             LogicalPlan::Sort(sort) => {
+                let normalized_sort_keys = sort
+                    .expr
+                    .iter()
+                    .map(|e| match e {
+                        Expr::Sort(ExprSort { expr, .. }) => {
+                            Expr::Sort(ExprSort::new(expr.clone(), true, false))

Review Comment:
   Your conclusion is right.  The `true`, `fase` is just for normalize and dedup.



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