Skip to content

Commit f82d0a1

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! fixup! WIP
1 parent ce47585 commit f82d0a1

File tree

5 files changed

+7
-27
lines changed

5 files changed

+7
-27
lines changed

datafusion/core/src/datasource/listing/table.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,11 +1159,6 @@ mod tests {
11591159
// (file_sort_order, expected_result)
11601160
let cases = vec![
11611161
(vec![], Ok(vec![])),
1162-
// not a sort expr
1163-
(
1164-
vec![vec![col("string_col").sort(true, false)]],
1165-
Err("Expected Expr::Sort in output_ordering, but got string_col"),
1166-
),
11671162
// sort expr, but non column
11681163
(
11691164
vec![vec![

datafusion/core/tests/expr_api/mod.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use arrow_array::builder::{ListBuilder, StringBuilder};
2020
use arrow_array::{ArrayRef, Int64Array, RecordBatch, StringArray, StructArray};
2121
use arrow_schema::{DataType, Field};
2222
use datafusion::prelude::*;
23-
use datafusion_common::{assert_contains, DFSchema, ScalarValue};
23+
use datafusion_common::{DFSchema, ScalarValue};
2424
use datafusion_expr::ExprFunctionExt;
2525
use datafusion_functions::core::expr_ext::FieldAccessor;
2626
use datafusion_functions_aggregate::first_last::first_value_udaf;
@@ -167,21 +167,6 @@ fn test_list_range() {
167167
);
168168
}
169169

170-
#[tokio::test]
171-
async fn test_aggregate_error() {
172-
let err = first_value_udaf()
173-
.call(vec![col("props")])
174-
// not a sort column
175-
.order_by(vec![col("id").sort(true, false)])
176-
.build()
177-
.unwrap_err()
178-
.to_string();
179-
assert_contains!(
180-
err,
181-
"Error during planning: ORDER BY expressions must be Expr::Sort"
182-
);
183-
}
184-
185170
#[tokio::test]
186171
async fn test_aggregate_ext_order_by() {
187172
let agg = first_value_udaf().call(vec![col("props")]);

datafusion/optimizer/src/eliminate_limit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ mod tests {
187187
// After remove global-state, we don't record the parent <skip, fetch>
188188
// So, bottom don't know parent info, so can't eliminate.
189189
let expected = "Limit: skip=2, fetch=1\
190-
\n Sort: test.a, fetch=3\
190+
\n Sort: test.a ASC NULLS LAST, fetch=3\
191191
\n Limit: skip=0, fetch=2\
192192
\n Aggregate: groupBy=[[test.a]], aggr=[[sum(test.b)]]\
193193
\n TableScan: test";
@@ -205,7 +205,7 @@ mod tests {
205205
.build()?;
206206

207207
let expected = "Limit: skip=0, fetch=1\
208-
\n Sort: test.a\
208+
\n Sort: test.a ASC NULLS LAST\
209209
\n Limit: skip=0, fetch=2\
210210
\n Aggregate: groupBy=[[test.a]], aggr=[[sum(test.b)]]\
211211
\n TableScan: test";
@@ -223,7 +223,7 @@ mod tests {
223223
.build()?;
224224

225225
let expected = "Limit: skip=3, fetch=1\
226-
\n Sort: test.a\
226+
\n Sort: test.a ASC NULLS LAST\
227227
\n Limit: skip=2, fetch=1\
228228
\n Aggregate: groupBy=[[test.a]], aggr=[[sum(test.b)]]\
229229
\n TableScan: test";

datafusion/optimizer/src/push_down_limit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ mod test {
354354

355355
// Should push down limit to sort
356356
let expected = "Limit: skip=0, fetch=10\
357-
\n Sort: test.a, fetch=10\
357+
\n Sort: test.a ASC NULLS LAST, fetch=10\
358358
\n TableScan: test";
359359

360360
assert_optimized_plan_equal(plan, expected)
@@ -371,7 +371,7 @@ mod test {
371371

372372
// Should push down limit to sort
373373
let expected = "Limit: skip=5, fetch=10\
374-
\n Sort: test.a, fetch=15\
374+
\n Sort: test.a ASC NULLS LAST, fetch=15\
375375
\n TableScan: test";
376376

377377
assert_optimized_plan_equal(plan, expected)

datafusion/optimizer/src/single_distinct_to_groupby.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ mod tests {
631631
.aggregate(vec![col("c")], vec![expr, count_distinct(col("b"))])?
632632
.build()?;
633633
// Do nothing
634-
let expected = "Aggregate: groupBy=[[test.c]], aggr=[[sum(test.a) ORDER BY [test.a], count(DISTINCT test.b)]] [c:UInt32, sum(test.a) ORDER BY [test.a]:UInt64;N, count(DISTINCT test.b):Int64]\
634+
let expected = "Aggregate: groupBy=[[test.c]], aggr=[[sum(test.a) ORDER BY [test.a ASC NULLS LAST], count(DISTINCT test.b)]] [c:UInt32, sum(test.a) ORDER BY [test.a ASC NULLS LAST]:UInt64;N, count(DISTINCT test.b):Int64]\
635635
\n TableScan: test [a:UInt32, b:UInt32, c:UInt32]";
636636

637637
assert_optimized_plan_equal(plan, expected)

0 commit comments

Comments
 (0)