Commit 82e461a
committed
[SPARK-35381][R] Fix lambda variable name issues in nested higher order functions at R APIs
This PR fixes the same issue as #32424
```r
df <- sql("SELECT array(1, 2, 3) as numbers, array('a', 'b', 'c') as letters")
collect(select(
df,
array_transform("numbers", function(number) {
array_transform("letters", function(latter) {
struct(alias(number, "n"), alias(latter, "l"))
})
})
))
```
**Before:**
```
... a, a, b, b, c, c, a, a, b, b, c, c, a, a, b, b, c, c
```
**After:**
```
... 1, a, 1, b, 1, c, 2, a, 2, b, 2, c, 3, a, 3, b, 3, c
```
To produce the correct results.
Yes, it fixes the results to be correct as mentioned above.
Manually tested as above, and unit test was added.
Closes #32517 from HyukjinKwon/SPARK-35381.
Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit ecb48cc)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>1 parent f88a522 commit 82e461a
2 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3578 | 3578 | | |
3579 | 3579 | | |
3580 | 3580 | | |
3581 | | - | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
3582 | 3587 | | |
3583 | 3588 | | |
3584 | 3589 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2153 | 2153 | | |
2154 | 2154 | | |
2155 | 2155 | | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
2156 | 2170 | | |
2157 | 2171 | | |
2158 | 2172 | | |
| |||
0 commit comments