Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing With Graph Data #18752

Closed
sstubbs opened this issue Jul 23, 2020 · 7 comments
Closed

Dealing With Graph Data #18752

sstubbs opened this issue Jul 23, 2020 · 7 comments
Labels
type/question The issue belongs to a question.

Comments

@sstubbs
Copy link

sstubbs commented Jul 23, 2020

Feature Request

Is your feature request related to a problem? Please describe:
I'm currently moving a posgres database to tidb. I have some directed acyclic graph data. One table with nodes and another with edges. In terms of querying it I need to find all parents and all children of a node. In postgres I use a recursive CTE. I see there is no recursive CTE or graph support like mariadb has https://mariadb.com/kb/en/oqgraph-storage-engine/ and would like to know if there are any plans to add either or both of these.

Describe the feature you'd like:
Recursive CTE or ideally graph data types support.

Describe alternatives you've considered:
I have considered using a separate database like dgraph or neo4j for the data but then this will not be ACID compliant.

@sstubbs sstubbs added the type/feature-request Categorizes issue or PR as related to a new feature. label Jul 23, 2020
@ghost
Copy link

ghost commented Jul 23, 2020

Support for CTEs is planned. You can track it in the following issues:

There are no current plans for a separate engine, such as OQGraph. Thank you for using TiDB, please let us know if you have other migration questions :-)

@ghost ghost added type/question The issue belongs to a question. and removed type/feature-request Categorizes issue or PR as related to a new feature. labels Jul 23, 2020
@sstubbs
Copy link
Author

sstubbs commented Jul 23, 2020

Is there any other solution to this problem other than using either of these methods? I've looked at spark but I don't see a solution. I would rather not revert to using mysql or mariadb just for this feature.

@sstubbs
Copy link
Author

sstubbs commented Jul 23, 2020

Perhaps running something like dgraph for the graph data along side tidb is the best solution. Otherwise running janusgraph or cayley on top of tidb.

@sstubbs
Copy link
Author

sstubbs commented Jul 23, 2020

Seeing as my graph requirement is fairly simple I'm going to have a go at creating a project with the petgraph crate and tikv client and see how that performs.

@ghost
Copy link

ghost commented Jul 23, 2020

Is there any other solution to this problem other than using either of these methods? I've looked at spark but I don't see a solution. I would rather not revert to using mysql or mariadb just for this feature.

Non-recursive CTEs can be emulated with temporary tables, but recursive is much harder - the queries tend to use self-joins and look much more complicated. I understand your desire to have this feature, and like you I am hoping that it is added soon :-)

@tisonkun
Copy link
Contributor

tisonkun commented Jun 1, 2021

@wjhuang2016 I think we can close this issue prefer #17472.

@sstubbs @nullnotnil there is an ongoing develop effort on both recursive and non-recursive CTE to TiDB. Feel free to track it from #17472 and https://github.com/orgs/pingcap/projects/37 , or throw any ideas about it.

@wjhuang2016
Copy link
Member

Yes, I think recursive CTE can solve this problem. Please refer to #17472. I am going to close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question The issue belongs to a question.
Projects
None yet
Development

No branches or pull requests

3 participants