Commit aa89883
[SPARK-52046][SQL] Prettify OuterReference on AggregateExpression names when using toPrettySQL
### What changes were proposed in this pull request?
In this PR I propose that we remove backticks, qualifiers from `OuterReference` over `AggregateExpression` when creating name. In other words, name for `column` which is an outer reference would be `outer(min(column))` instead of `outer('min(col)')`.
We also introduce a flag to guard the behavior as it changes the schema of some specific `LATERAL JOIN` queries.
### Why are the changes needed?
To ease development of single-pass analyzer and improve names in fixed-point implementation.
### Does this PR introduce _any_ user-facing change?
Schema changes in a way that `OuterReference` over `AggregateExpression` name doesn't contain backticks and qualifiers.
### How was this patch tested?
Existing tests.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes apache#50836 from mihailoale-db/prettifyouterrefname.
Authored-by: mihailoale-db <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>1 parent 10c7614 commit aa89883
File tree
2 files changed
+38
-7
lines changed- sql/catalyst/src/main/scala/org/apache/spark/sql
- catalyst/util
- internal
2 files changed
+38
-7
lines changedLines changed: 30 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
106 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
112 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
113 | 128 | | |
114 | 129 | | |
115 | 130 | | |
| |||
119 | 134 | | |
120 | 135 | | |
121 | 136 | | |
122 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
123 | 141 | | |
124 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
125 | 146 | | |
126 | 147 | | |
127 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
128 | 151 | | |
129 | 152 | | |
130 | 153 | | |
131 | | - | |
| 154 | + | |
132 | 155 | | |
133 | 156 | | |
134 | 157 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5818 | 5818 | | |
5819 | 5819 | | |
5820 | 5820 | | |
| 5821 | + | |
| 5822 | + | |
| 5823 | + | |
| 5824 | + | |
| 5825 | + | |
| 5826 | + | |
| 5827 | + | |
| 5828 | + | |
5821 | 5829 | | |
5822 | 5830 | | |
5823 | 5831 | | |
| |||
0 commit comments