sqlwindspeaker opened a new pull request #30910: URL: https://github.com/apache/spark/pull/30910
### What changes were proposed in this pull request? See SPARK-33837, In ResolveSubquery rule, we first try to resolve subquery independently, and only when there're unresolved attribute in subquery, we try resolveOuterReferences. So For the following statements: ``` create table t1(id int, name string) create table id(key int, name string); select * from id where name in (select name from t1 where t1.id = id.key) ``` This query is supported by spark, but since table t1 also has an attribute named id, spark will raise an error like: > Can't extract value from id#83: need struct type but got int; This change add outer plan info into resolving subquery to make this reference resolving with outer plan possible ### Does this PR introduce _any_ user-facing change? Yes ### How was this patch tested? Unit tests needs to be added ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
