forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding pgq keywords to colid & non-reserved keywords
- Loading branch information
Showing
5 changed files
with
17,344 additions
and
16,861 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
statement ok | ||
pragma enable_verification | ||
|
||
require duckpgq | ||
|
||
statement ok | ||
select 1 as path; | ||
|
||
statement ok | ||
select 1 as group; | ||
|
||
statement ok | ||
SELECT database_oid AS seq, database_name AS name, path AS file FROM duckdb_databases() WHERE NOT internal ORDER BY 1 | ||
|
||
statement ok | ||
CREATE TABLE Student(id BIGINT, name VARCHAR); | ||
|
||
statement ok | ||
CREATE TABLE know(src BIGINT, dst BIGINT, createDate BIGINT); | ||
|
||
statement ok | ||
CREATE TABLE School(name VARCHAR, Id BIGINT, Kind VARCHAR); | ||
|
||
statement ok | ||
CREATE TABLE StudyAt(personId BIGINT, schoolId BIGINT); | ||
|
||
statement ok | ||
INSERT INTO Student VALUES (0, 'Daniel'), (1, 'Tavneet'), (2, 'Gabor'), (3, 'Peter'), (4, 'David'); | ||
|
||
statement ok | ||
INSERT INTO know VALUES (0,1, 10), (0,2, 11), (0,3, 12), (3,0, 13), (1,2, 14), (1,3, 15), (2,3, 16), (4,3, 17); | ||
|
||
statement ok | ||
INSERT INTO School VALUES ('VU', 0, 'University'), ('UVA', 1, 'University'); | ||
|
||
statement ok | ||
INSERT INTO StudyAt VALUES (0, 0), (1, 0), (2, 1), (3, 1), (4, 1); | ||
|
||
statement ok | ||
-CREATE PROPERTY GRAPH pg | ||
VERTEX TABLES ( | ||
Student PROPERTIES ( id, name ) LABEL Person, | ||
School LABEL SCHOOL | ||
) | ||
EDGE TABLES ( | ||
know SOURCE KEY ( src ) REFERENCES Student ( id ) | ||
DESTINATION KEY ( dst ) REFERENCES Student ( id ) | ||
LABEL Knows, | ||
studyAt SOURCE KEY ( personId ) REFERENCES Student ( id ) | ||
DESTINATION KEY ( SchoolId ) REFERENCES School ( id ) | ||
LABEL StudyAt | ||
); | ||
|
||
query II | ||
-SELECT study.name, study.school | ||
FROM GRAPH_TABLE (pg | ||
MATCH | ||
(a:Person)-[s:StudyAt]->(b:School) | ||
WHERE a.name = 'Daniel' | ||
COLUMNS (a.name as name, b.name as school) | ||
) study; | ||
---- | ||
Daniel VU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.