We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0f3189 commit 86526fdCopy full SHA for 86526fd
datafusion/sql/src/expr/order_by.rs
@@ -47,6 +47,10 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
47
literal_to_column: bool,
48
additional_schema: Option<&DFSchema>,
49
) -> Result<Vec<SortExpr>> {
50
+ if order_by_exprs.is_empty() {
51
+ return Ok(vec![]);
52
+ }
53
+
54
let mut combined_schema;
55
let order_by_schema = match additional_schema {
56
Some(schema) => {
@@ -57,11 +61,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
57
61
None => input_schema,
58
62
};
59
63
60
- if order_by_exprs.is_empty() {
- return Ok(vec![]);
- }
-
64
- let mut sort_expr_vec = vec![];
+ let mut sort_expr_vec = Vec::with_capacity(order_by_exprs.len());
65
66
let make_sort_expr =
67
|expr: Expr, asc: Option<bool>, nulls_first: Option<bool>| {
0 commit comments