chasingegg commented on pull request #35290: URL: https://github.com/apache/spark/pull/35290#issuecomment-1035997195
> > My point is when you do select a from (select a, a union select a, b), it will not fail but produce unexpected result. > > Are you sure this won't fail? I thought the output column names of Union are the same with its first child, so `select a` should fail because the name is ambiguous. It won't fail. Spark will check if the name could be mapped to multiple attr ids, if not(like our cases: a#1, a#1), it won't fail because Spark thinks that two columns are totally the same, not ambiguous. It will fail in `a#1, a#2` case, which is what we expect here. Therefore, I will prefer to carefully add alias when two children of union are conflict. I will find some time to implement it and update the PR in master branch. -- 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]
