xudong963 commented on code in PR #15772:
URL: https://github.com/apache/datafusion/pull/15772#discussion_r2072637668


##########
datafusion/sql/src/expr/order_by.rs:
##########
@@ -61,13 +57,27 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
             None => input_schema,
         };
 
-        let mut expr_vec = vec![];
-        for e in exprs {
+        if order_by_exprs.is_empty() {
+            return Ok(vec![]);
+        }

Review Comment:
   Why put the early return here? IMO, the earlier we do the check, the more 
useless computation we can avoid.



-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to