AngersZhuuuu opened a new pull request #33183:
URL: https://github.com/apache/spark/pull/33183
### What changes were proposed in this pull request?
In our product env, we meet a case that when matching NestedColumnAliasing.
In the first loop we got nestedFieldReferences as below,
```
data.a
data.a.b
data.a.c
data.a.d
```
then after handle duplicated we got alias map
```
data.a -> gen_alias_xxxx
```
but when call replaceToAliases -> getNewProjectList, when replace
`data.a.b` , `data.a.c` , `data.a.d` it can't match since we call
`map.contains`.
Then the nest loop we got nestedFieldReferences as below,
```
data.a.b
data.a.c
data.a.d
```
but we gen aliasMap as
```
data -> gen_alias_xxx
```
```
data.a.b -> gen_alias_yyy
data.a.c -> gen_alias_zzz
data.a.d -> gen_alias_uuu
```
attrToAliases as
```
data -> [gen_alias_yyy, gen_alias_zzz, gen_alias_uuu]
```
since we got the reference as `data`,
but in current's project 's child's output, we don't contains `data` since
we have replace it to `data.a`
then the final plan when execute will throw exception like
```
Couldn't find _gen_alias_yyy#yyy in [.......]
```
### Why are the changes needed?
Fix bug
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Manul tested
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]