Commit 6d525cf
Add preferred_ordering field to TableScan
This commit adds a new optional field `preferred_ordering` to the `TableScan`
logical plan node to support sort pushdown optimizations.
Changes include:
- Add `preferred_ordering: Option<Vec<SortExpr>>` field to `TableScan` struct
- Add `try_new_with_preferred_ordering` constructor method
- Update all `TableScan` constructors throughout the codebase to include the new field
- Update `Debug`, `PartialEq`, `Hash`, and `PartialOrd` implementations
- Update pattern matching in optimizer and other modules
The preferred_ordering field is currently not used by any optimization rules
but provides the foundation for future sort pushdown implementations.
This is part 2 of 2 PRs split from apache#17273 as requested in
apache#17273 (comment)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent b6a8a0e commit 6d525cf
File tree
5 files changed
+32
-1
lines changed- datafusion
- expr/src/logical_plan
- optimizer/src
- optimize_projections
- proto/src/logical_plan
5 files changed
+32
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2525 | 2525 | | |
2526 | 2526 | | |
2527 | 2527 | | |
| 2528 | + | |
| 2529 | + | |
2528 | 2530 | | |
2529 | 2531 | | |
2530 | 2532 | | |
| |||
2536 | 2538 | | |
2537 | 2539 | | |
2538 | 2540 | | |
| 2541 | + | |
2539 | 2542 | | |
2540 | 2543 | | |
2541 | 2544 | | |
| |||
2547 | 2550 | | |
2548 | 2551 | | |
2549 | 2552 | | |
| 2553 | + | |
2550 | 2554 | | |
2551 | 2555 | | |
2552 | 2556 | | |
| |||
2566 | 2570 | | |
2567 | 2571 | | |
2568 | 2572 | | |
| 2573 | + | |
| 2574 | + | |
2569 | 2575 | | |
2570 | 2576 | | |
2571 | 2577 | | |
2572 | 2578 | | |
2573 | 2579 | | |
2574 | 2580 | | |
| 2581 | + | |
2575 | 2582 | | |
2576 | 2583 | | |
2577 | 2584 | | |
2578 | 2585 | | |
2579 | 2586 | | |
2580 | 2587 | | |
| 2588 | + | |
2581 | 2589 | | |
2582 | 2590 | | |
2583 | 2591 | | |
| |||
2590 | 2598 | | |
2591 | 2599 | | |
2592 | 2600 | | |
| 2601 | + | |
2593 | 2602 | | |
2594 | 2603 | | |
2595 | 2604 | | |
| |||
2643 | 2652 | | |
2644 | 2653 | | |
2645 | 2654 | | |
| 2655 | + | |
2646 | 2656 | | |
2647 | 2657 | | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
2648 | 2671 | | |
2649 | 2672 | | |
2650 | 2673 | | |
| |||
4814 | 4837 | | |
4815 | 4838 | | |
4816 | 4839 | | |
| 4840 | + | |
4817 | 4841 | | |
4818 | 4842 | | |
4819 | 4843 | | |
| |||
4844 | 4868 | | |
4845 | 4869 | | |
4846 | 4870 | | |
| 4871 | + | |
4847 | 4872 | | |
4848 | 4873 | | |
4849 | 4874 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
| 602 | + | |
602 | 603 | | |
603 | 604 | | |
604 | 605 | | |
| |||
607 | 608 | | |
608 | 609 | | |
609 | 610 | | |
| 611 | + | |
610 | 612 | | |
611 | 613 | | |
612 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| |||
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
253 | | - | |
| 254 | + | |
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3055 | 3055 | | |
3056 | 3056 | | |
3057 | 3057 | | |
| 3058 | + | |
3058 | 3059 | | |
3059 | 3060 | | |
3060 | 3061 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| |||
0 commit comments