Commit 99b7d2a
[SPARK-51673][SQL] Apply default collation to alter view query
### What changes were proposed in this pull request?
Fixed the application of default collation in `ALTER VIEW` queries. For example, if a view has a default collation and we execute `ALTER VIEW v AS SELECT 'a' AS c1`, the default collation was not being applied to the literal `a`.
### Why are the changes needed?
Bug fix.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Tests added to `DefaultCollationTestSuite.scala`
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #50468 from ilicmarkodb/fix_alter_view.
Authored-by: ilicmarkodb <[email protected]>
Signed-off-by: Max Gekk <[email protected]>1 parent 6692642 commit 99b7d2a
File tree
3 files changed
+78
-9
lines changed- sql
- catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis
- core/src
- main/scala/org/apache/spark/sql/execution/command
- test/scala/org/apache/spark/sql/collation
3 files changed
+78
-9
lines changedLines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
69 | 82 | | |
70 | 83 | | |
71 | 84 | | |
| |||
Lines changed: 27 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
739 | 740 | | |
740 | 741 | | |
741 | 742 | | |
742 | | - | |
743 | | - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
744 | 747 | | |
745 | 748 | | |
746 | 749 | | |
| |||
754 | 757 | | |
755 | 758 | | |
756 | 759 | | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
757 | 770 | | |
758 | 771 | | |
759 | 772 | | |
| |||
762 | 775 | | |
763 | 776 | | |
764 | 777 | | |
765 | | - | |
| 778 | + | |
| 779 | + | |
766 | 780 | | |
767 | 781 | | |
768 | | - | |
| 782 | + | |
769 | 783 | | |
770 | 784 | | |
771 | 785 | | |
| |||
795 | 809 | | |
796 | 810 | | |
797 | 811 | | |
798 | | - | |
| 812 | + | |
| 813 | + | |
799 | 814 | | |
800 | 815 | | |
801 | 816 | | |
| |||
812 | 827 | | |
813 | 828 | | |
814 | 829 | | |
815 | | - | |
| 830 | + | |
| 831 | + | |
816 | 832 | | |
817 | 833 | | |
818 | 834 | | |
| |||
821 | 837 | | |
822 | 838 | | |
823 | 839 | | |
824 | | - | |
| 840 | + | |
| 841 | + | |
825 | 842 | | |
826 | 843 | | |
827 | 844 | | |
828 | 845 | | |
829 | 846 | | |
830 | | - | |
| 847 | + | |
| 848 | + | |
831 | 849 | | |
832 | 850 | | |
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
478 | 516 | | |
479 | 517 | | |
480 | 518 | | |
| |||
0 commit comments