-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error handling on creating property graphs #26
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi @Dtenwolde , I would like to know more about duckdb and pgq; I'm wondering if you could provide me some code pointers, and if I could take some of the low-priority tickets mentioned in the issue? Thank you! |
Hi @dentiny, thanks for showing interest! This issue is partially outdated, I haven't found the time yet to verify all of the cases above actually have the correct behaviour of throwing an error. In case you want to work on this I would greatly appreciate it! Alternatively, if you want to work on implementing a new feature I think supporting more graph algorithms would be nice, I have a list here: #132. The list is mostly a guideline, so if you have another algorithm in mind that's not on the list then let me know :) Let me know what you'd like to work on and reach out if you have any questions! :) |
Thank you so much for your kind word and guidance! I will try to get myself familiar with the proj and see if I could help with the error handling. |
I check a few items listed in the PR description. Preparation:
As for other cases:
I feel like neither the property graph creation nor the the query has nothing to do with pgq extension, which should be handled by duckdb itself. Let me know if there's anything else I could do. :) |
Thanks for checking!
This is indeed something that should be handled by DuckDB, not by DuckPGQ. All the other points seem to be handled properly. One small note with regards to "Column of a table does not exist": -SELECT count(id)FROM GRAPH_TABLE (socialNetwork MATCH p = ANY SHORTEST (p1:unknown_col WHERE p1.name='Bob') -[f:follows]-> *(p2:person) -[l:livesIn]->(c:city WHERE c.name='Utrecht') COLUMNS (p2.id));
Binder Error: The label unknown_col is not registered in property graph SocialNetwork This now checks if the label is correctly registered But with your example, I just checked and the non-existing column seems to be handled properly: ⚫◗ SELECT count(coldoesnotexist) FROM GRAPH_TABLE (SocialNetwork MATCH p = ANY SHORTEST (p1:person WHERE p1.name='Bob') -[f:follows]-> *(p2:person) -[l:livesIn]->(c:city WHERE c.name='Utrecht') COLUMNS (p2.id));
Run Time (s): real 0.009 user 0.001437 sys 0.003755
Binder Error: Referenced column "coldoesnotexist" not found in FROM clause!
Candidate bindings: "unnamed_graphtable.id"
LINE 1: SELECT count(coldoesnotexist) FROM GRAPH_TABLE (Soc... There's a feature in SQL/PGQ where users can specify which CREATE TABLE Person(
id BIGINT PRIMARY KEY,
name VARCHAR
);
INSERT INTO Person VALUES (0, 'Foo'), (1, 'Bar');
CREATE PROPERTY GRAPH g VERTEX TABLES (Person PROPERTIES (id)); -- We only select the ID column here as property, not name
SELECT * FROM GRAPH_TABLE (g MATCH (p:Person));
┌───────┬─────────┐
│ id │ name │
│ int64 │ varchar │
├───────┼─────────┤
│ 0 │ Foo │
│ 1 │ Bar │
└───────┴─────────┘ According to the official specification, this result is incorrect and should only return the SELECT * FROM GRAPH_TABLE (g MATCH (p:Person) COLUMNS (p.id, p.name)); This should throw an error message stating, I don't expect this to be a high-priority issue, but it's worth noting that this should be fixed sometime. I think we'd have to add a check here to see if the column is actually registered for the given vertex or edge table, and if not throw an error. In Another relatively simple issue: #187 Other issues often involve translating the query plan (#183, #112) or adding changes to the parser (#43, #14) which are more complex. Finally, I am on holiday for the next two weeks, but I'll still check my mail but I might not do as much coding :) |
Thank you for the correction and checking!
Good to know! I would like to work on these.
I haven't digged into the graph algorithm, I would like to take a look first.
Happy holiday Daniël! |
Should throw a catalog/Binder exception
- [ ] FK of a table does not exist- [ ] Primary keys are not unique- [ ] FK of source of edge table does not exist- [ ] Multiple PKs are referenced from source/destination table (How would this work?)The text was updated successfully, but these errors were encountered: