Uh oh!
There was an error while loading. Please reload this page.
[WIP][SPARK-24497][SQL] Support recursive SQL query - #29210
Conversation
This is the static version of #23531 which means this PR doesn't do adaptive replanning in each recursive iteration, but the advantage is that the implementation comes with simplified code. Common relational DB implementations don't do replanning either. @maropu this is very close to what you suggested before, if you have some time please review. @maryannxue I think we can add adaptive support in a follow-up PR if needed. |
SparkQA
commented
Jul 23, 2020
Test build #126431 has finished for PR 29210 at commit
|
maropu
commented
Jul 24, 2020
The simpler design as a first step looks fine to me. Anyone preferring the adaptive one for this? I think we need to choose which approach to take first. @maryannxue@viirya@gatorsmile@viirya |
…497-recursive-sql-static
SparkQA
commented
Jul 24, 2020
Test build #126490 has finished for PR 29210 at commit
|
| CREATE TEMPORARY VIEW t AS SELECT * FROM VALUES 0, 1, 2 AS t(id); | ||
| -- fails due to recursion isn't allowed with RECURSIVE keyword |
SparkQA
commented
Sep 1, 2020
Test build #128152 has finished for PR 29210 at commit
|
peter-toth
commented
Sep 1, 2020
retest this please |
SparkQA
commented
Sep 2, 2020
Test build #128162 has finished for PR 29210 at commit
|
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
SparkQA
commented
Feb 4, 2021
Kubernetes integration test starting |
SparkQA
commented
Feb 4, 2021
Kubernetes integration test status failure |
SparkQA
commented
Feb 4, 2021
Test build #134884 has finished for PR 29210 at commit
|
SparkQA
commented
Feb 4, 2021
Kubernetes integration test starting |
SparkQA
commented
Feb 4, 2021
Kubernetes integration test status success |
SparkQA
commented
Feb 5, 2021
Test build #134890 has finished for PR 29210 at commit
|
SparkQA
commented
Feb 5, 2021
Kubernetes integration test starting |
SparkQA
commented
Feb 5, 2021
Kubernetes integration test status success |
SparkQA
commented
Feb 5, 2021
Test build #134933 has finished for PR 29210 at commit
|
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
I'm happy to update this PR if anyone is willing to review it. Just let me know... |
phancey
commented
Jul 19, 2021
I would like to see recursive queries - why did this not go through? Is there an alternative? |
timschwab
commented
Oct 14, 2021
Pinging this to ensure it doesn't fall through the cracks. I'm currently hitting the common use case of wanting to create a materialized path from an adjacency list, and not having recursive queries built into Spark makes this more painful and less performant. |
Another +1, ran into a use case where recursive queries were needed and alternate technology was utilized to solve because it was not available in Spark SQL. |
peter-toth
commented
Jul 25, 2022
Thanks for the feedback. I will try to rebase this PR on the latest |
peter-toth
commented
Jan 17, 2023
Sorry guys, this is unlikely to land in Spark 3.4, maybe in 3.5... |
wangyum
commented
Jan 18, 2023
@peter-toth Could you rebase this PR on the master branch. I have removed the Stale tag. |
peter-toth
commented
Jan 18, 2023
@wangyum, unfortunately this is a very old PR and a lots of changes are needed to make it work on the latest Spark. Let me close the PR for now and reopen once I have a working solution. |
peter-toth
commented
Apr 19, 2023
This PR is rebased on latest |
What changes were proposed in this pull request?
This PR adds recursive query feature to Spark SQL.
A recursive query is defined using the
WITH RECURSIVEkeywords and referring the name of the common table expression within the query.The implementation complies with SQL standard and follows similar rules to other relational databases:
UNIONorUNION ALLoperators.Please see
cte-recursive.sqlandwith.sqlfor some examples.Please note that this PR focuses on the minimal working implementation which means:
Why are the changes needed?
Recursive query is an ANSI SQL feature that is useful to process hierarchical data.
Does this PR introduce any user-facing change?
Yes, adds recursive query feature.
How was this patch tested?
Added new UTs and tests in
cte-recursion.sqlandwith.sql.