I am migrating sql from mysql to spark sql, meet a very strange case. Below is code to reproduce the exception:
Base the trace log ,seemly the WidenSetOperationTypes add new outer project layer. It caused the parent query lose the reference to subquery.
in the source code ,WidenSetOperationTypes.scala. it is a intent behavior, but possibly miss this edge case.
I hope someone can help me out to fix it .