Commit 386e464
[SPARK-52870][SQL] Properly quote variable names in
### What changes were proposed in this pull request?
This PR fixes the bugs presented in https://issues.apache.org/jira/browse/SPARK-52870 . Before this change, we passed FOR statement referenced column names as multipart identifiers to `SetVariable`. This fails when the columns are not formatted as proper multipart identifiers. This PR changes the logic to always quote the column names, similar to how backticks are used from the SQL side.
### Why are the changes needed?
Bugfix.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Unit tests added.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes apache#51560 from dusantism-db/for-quote-variable-names.
Authored-by: Dušan Tišma <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>FOR statement1 parent f8c2671 commit 386e464
File tree
2 files changed
+73
-1
lines changed- sql/core/src
- main/scala/org/apache/spark/sql/scripting
- test/scala/org/apache/spark/sql/scripting
2 files changed
+73
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1187 | 1187 | | |
1188 | 1188 | | |
1189 | 1189 | | |
1190 | | - | |
| 1190 | + | |
1191 | 1191 | | |
1192 | 1192 | | |
1193 | 1193 | | |
| |||
Lines changed: 72 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2938 | 2938 | | |
2939 | 2939 | | |
2940 | 2940 | | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
2941 | 3013 | | |
0 commit comments