Skip to content

Commit a8b64b8

Browse files
committed
fix test
1 parent 04cd30c commit a8b64b8

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

datafusion/core/tests/user_defined/user_defined_plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl OptimizerRule for TopKOptimizerRule {
523523
}) = limit.input.as_ref()
524524
{
525525
if expr.len() == 1 {
526-
// we found a sort with a single sort expr, replace with a a TopK
526+
// we found a sort with a single sort expr, replace with a TopK
527527
return Ok(Transformed::yes(LogicalPlan::Extension(Extension {
528528
node: Arc::new(TopKPlanNode {
529529
k: fetch,

datafusion/optimizer/src/push_down_limit.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ impl OptimizerRule for PushDownLimit {
128128
let original_sort_fetch = sort.fetch;
129129
let new_fetch = {
130130
let sort_fetch = skip + fetch;
131-
Some(original_sort_fetch.map(|f| f.min(sort_fetch)).unwrap_or(sort_fetch))
131+
Some(
132+
original_sort_fetch
133+
.map(|f| f.min(sort_fetch))
134+
.unwrap_or(sort_fetch),
135+
)
132136
};
133137
if new_fetch == sort.fetch {
134138
if skip > 0 {
@@ -593,9 +597,7 @@ mod test {
593597
.build()?;
594598

595599
// Should push down limit to sort
596-
let expected = "Limit: skip=0, fetch=10\
597-
\n Sort: test.a ASC NULLS LAST, fetch=10\
598-
\n TableScan: test";
600+
let expected = "Sort: test.a ASC NULLS LAST, fetch=10\n TableScan: test";
599601

600602
assert_optimized_plan_equal(plan, expected)
601603
}

0 commit comments

Comments
 (0)