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


##########
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![]);
+        }
+
+        let mut sort_expr_vec = vec![];

Review Comment:
   I usually incline to give it a pre-allocation



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