File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments