Commit c7ba5c7
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 <[email protected]>1 parent b27fedc commit c7ba5c7
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 | |
|---|---|---|---|
| |||
2608 | 2608 | | |
2609 | 2609 | | |
2610 | 2610 | | |
| 2611 | + | |
| 2612 | + | |
2611 | 2613 | | |
2612 | 2614 | | |
2613 | 2615 | | |
| |||
2619 | 2621 | | |
2620 | 2622 | | |
2621 | 2623 | | |
| 2624 | + | |
2622 | 2625 | | |
2623 | 2626 | | |
2624 | 2627 | | |
| |||
2630 | 2633 | | |
2631 | 2634 | | |
2632 | 2635 | | |
| 2636 | + | |
2633 | 2637 | | |
2634 | 2638 | | |
2635 | 2639 | | |
| |||
2649 | 2653 | | |
2650 | 2654 | | |
2651 | 2655 | | |
| 2656 | + | |
| 2657 | + | |
2652 | 2658 | | |
2653 | 2659 | | |
2654 | 2660 | | |
2655 | 2661 | | |
2656 | 2662 | | |
2657 | 2663 | | |
| 2664 | + | |
2658 | 2665 | | |
2659 | 2666 | | |
2660 | 2667 | | |
2661 | 2668 | | |
2662 | 2669 | | |
2663 | 2670 | | |
| 2671 | + | |
2664 | 2672 | | |
2665 | 2673 | | |
2666 | 2674 | | |
| |||
2676 | 2684 | | |
2677 | 2685 | | |
2678 | 2686 | | |
| 2687 | + | |
2679 | 2688 | | |
2680 | 2689 | | |
2681 | 2690 | | |
| |||
2729 | 2738 | | |
2730 | 2739 | | |
2731 | 2740 | | |
| 2741 | + | |
2732 | 2742 | | |
2733 | 2743 | | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
2734 | 2757 | | |
2735 | 2758 | | |
2736 | 2759 | | |
| |||
4823 | 4846 | | |
4824 | 4847 | | |
4825 | 4848 | | |
| 4849 | + | |
4826 | 4850 | | |
4827 | 4851 | | |
4828 | 4852 | | |
| |||
4853 | 4877 | | |
4854 | 4878 | | |
4855 | 4879 | | |
| 4880 | + | |
4856 | 4881 | | |
4857 | 4882 | | |
4858 | 4883 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
| |||
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | | - | |
| 272 | + | |
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| 278 | + | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3123 | 3123 | | |
3124 | 3124 | | |
3125 | 3125 | | |
| 3126 | + | |
3126 | 3127 | | |
3127 | 3128 | | |
3128 | 3129 | | |
| |||
| 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