Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-45584][SQL] Fix subquery execution failure with TakeOrderedAnd…
…ProjectExec ### What changes were proposed in this pull request? This PR fixes a bug when there are subqueries in `TakeOrderedAndProjectExec`. The executeCollect method does not wait for subqueries to finish and it can result in IllegalArgumentException when executing a simple query. For example this query: ``` WITH t2 AS ( SELECT * FROM t1 ORDER BY id ) SELECT *, (SELECT COUNT(*) FROM t2) FROM t2 LIMIT 10 ``` will fail with this error ``` java.lang.IllegalArgumentException: requirement failed: Subquery subquery#242, [id=#109] has not finished ``` ### Why are the changes needed? To fix a bug. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? New unit test ### Was this patch authored or co-authored using generative AI tooling? No Closes #43419 from allisonwang-db/spark-45584-subquery-failure. Authored-by: allisonwang-db <allison.wang@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
- Loading branch information