Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49646][SQL] add spark config for fixing subquery decorrelation…
… for union/set operations when parentOuterReferences has references not covered in collectedChildOuterReferences ### What changes were proposed in this pull request? Spark config added for this change: apache#48109 ### Why are the changes needed? For safer backports ### Does this PR introduce _any_ user-facing change? yes, adds a user-facing config `spark.sql.optimizer.decorrelateUnionOrSetOpUnderLimit.enabled`. Set it to true will enable decorrelating subqueries having correlated references under Union/Set operators which are under Limit operators. It is by default true, setting it to false make spark reverting to incorrect legacy behavior which raises exceptions when decorrelate the above query patterns. ### How was this patch tested? N/A ### Was this patch authored or co-authored using generative AI tooling? no Closes apache#49536 from AveryQi115/SPARK-49646-2. Lead-authored-by: Avery Qi <[email protected]> Co-authored-by: Avery <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>