Repository navigation
Commit aef8312
committed
fix: remove determined computed GROUP BY expressions from the GROUP BY key
`get_required_group_by_exprs_indices` gives up on any computed GROUP BY
expression, so the GROUP BY key kept every expression. A projection that
removed one of them dropped the key, and a query such as
`GROUP BY i_item_sk, s_date, upper(i_desc)` below an outer
`GROUP BY i_item_sk, s_date` failed to plan, although it plans on 55.2.0.
The new `group_by_key_indices` removes extraneous columns from the key
as before, and also a deterministic computed expression whose fields the
remaining key columns determine. A key left with no columns falls back to
the whole GROUP BY list.1 parent 730a9fe commit aef8312
2 files changed
Lines changed: 78 additions & 11 deletions
File tree
- datafusion
- common/src
- sqllogictest/test_files
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
580 | | - | |
| 580 | + | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
| 583 | + | |
| 584 | + | |
590 | 585 | | |
591 | 586 | | |
592 | 587 | | |
| |||
617 | 612 | | |
618 | 613 | | |
619 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
620 | 667 | | |
621 | 668 | | |
622 | 669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
821 | 841 | | |
822 | 842 | | |
823 | 843 | | |
| |||
829 | 849 | | |
830 | 850 | | |
831 | 851 | | |
832 | | - | |
| 852 | + | |
833 | 853 | | |
834 | 854 | | |
835 | 855 | | |
| |||
840 | 860 | | |
841 | 861 | | |
842 | 862 | | |
843 | | - | |
| 863 | + | |
844 | 864 | | |
845 | 865 | | |
846 | 866 | | |
| |||
0 commit comments