You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Tpt (via GitHub)" <gi...@apache.org> on 2025/11/26 20:57:08 UTC
[I] Support nested recursive CTEs [datafusion]
Tpt opened a new issue, #18955:
URL: https://github.com/apache/datafusion/issues/18955
### Is your feature request related to a problem or challenge?
SPARQL support nested property paths (i.e. regular expressions in the graph). For example `(p1 / p2+)+` to state "follow and edge labeled p1 then any number of edges labeled p2, all of this any number of times".
This can be implemented in DataFusion using nested recursive CTEs like
```sql
WITH RECURSIVE outer_cte AS (
SELECT start, end FROM graph WHERE label = 'p1'
UNION (
WITH RECURSIVE nested_cte AS (
SELECT start, end FROM graph WHERE label = 'p2'
UNION
SELECT nested_cte.start AS start, graph.end AS end FROM nested_cte, graph WHERE nested_cte.end = graph.start AND graph.label = 'p2'
)
SELECT outer_cte.start AS start, nested_cte.end AS end FROM outer_cte, nested_cte WHERE outer_cte.end = nested_cte.start
)
) SELECT * FROM outer_cte;
```
where `graph(start, label, end)` is the edge table
Sadly, nested CTEs are not supported in DataFusion yet
### Describe the solution you'd like
Enable nested recursive CTEs. A quick implementation might be to give each `WorkSet` plan node a name and use this name to allow the `RecursiveQueryExec` node to pick the correct `WorkSetExec` node to set
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
--
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: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Support nested recursive CTEs [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #18955: Support nested recursive CTEs
URL: https://github.com/apache/datafusion/issues/18955
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org