generated from duckdb/extension-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from cwida/61-support-explain-queries
Adding create property graph
- Loading branch information
Showing
6 changed files
with
217 additions
and
35 deletions.
There are no files selected for viewing
Submodule duckdb-pgq
updated
from bdbc60 to 8b4b26
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# name: test/sql/sqlpgq/copy_to_duckpgq.test | ||
# group: [duckpgq] | ||
|
||
require duckpgq | ||
|
||
statement ok | ||
import database 'duckdb-pgq/data/SNB0.003' | ||
|
||
statement ok | ||
-CREATE PROPERTY GRAPH snb | ||
VERTEX TABLES ( | ||
Person LABEL Person, | ||
Forum LABEL Forum, | ||
Organisation LABEL Organisation IN typemask(company, university), | ||
Place LABEL Place, | ||
Tag LABEL Tag, | ||
TagClass LABEL TagClass, | ||
Country LABEL Country, | ||
City LABEL City, | ||
Message LABEL Message | ||
) | ||
EDGE TABLES ( | ||
Person_knows_person SOURCE KEY (Person1Id) REFERENCES Person (id) | ||
DESTINATION KEY (Person2Id) REFERENCES Person (id) | ||
LABEL Knows, | ||
Forum_hasMember_Person SOURCE KEY (ForumId) REFERENCES Forum (id) | ||
DESTINATION KEY (PersonId) REFERENCES Person (id) | ||
LABEL hasMember, | ||
Forum_hasTag_Tag SOURCE KEY (ForumId) REFERENCES Forum (id) | ||
DESTINATION KEY (TagId) REFERENCES Tag (id) | ||
LABEL Forum_hasTag, | ||
Person_hasInterest_Tag SOURCE KEY (PersonId) REFERENCES Person (id) | ||
DESTINATION KEY (TagId) REFERENCES Tag (id) | ||
LABEL hasInterest, | ||
person_workAt_Organisation SOURCE KEY (PersonId) REFERENCES Person (id) | ||
DESTINATION KEY (OrganisationId) REFERENCES Organisation (id) | ||
LABEL workAt_Organisation, | ||
Person_likes_Message SOURCE KEY (PersonId) REFERENCES Person (id) | ||
DESTINATION KEY (id) REFERENCES Message (id) | ||
LABEL likes_Message, | ||
Message_hasTag_Tag SOURCE KEY (id) REFERENCES Message (id) | ||
DESTINATION KEY (TagId) REFERENCES Tag (id) | ||
LABEL message_hasTag, | ||
Message_hasAuthor_Person SOURCE KEY (messageId) REFERENCES Message (id) | ||
DESTINATION KEY (PersonId) REFERENCES Person (id) | ||
LABEL hasAuthor, | ||
Message_replyOf_Message SOURCE KEY (messageId) REFERENCES Message (id) | ||
DESTINATION KEY (ParentMessageId) REFERENCES Message (id) | ||
LABEL replyOf | ||
); | ||
|
||
# IS1 | ||
statement ok | ||
-COPY (FROM GRAPH_TABLE (snb | ||
MATCH (a is person where a.id = 17592186044461) | ||
COLUMNS(a.firstName, a.lastName, a.birthday, a.locationIP, a.browserUsed, a.LocationCityId, a.gender, a.creationDate) | ||
) tmp) TO '__TEST_DIR__/is1.csv' (HEADER FALSE); | ||
|
||
query IIIIIIII | ||
SELECT * FROM '__TEST_DIR__/is1.csv'; | ||
---- | ||
Ali Abouba 1987-05-29 41.203.147.168 Internet Explorer 1264 male 2011-05-12 02:46:47.595 | ||
|
||
statement ok | ||
-CREATE TABLE result as (FROM GRAPH_TABLE (snb | ||
MATCH (a is person where a.id = 17592186044461) | ||
COLUMNS(a.firstName, a.lastName, a.birthday, a.locationIP, a.browserUsed, a.LocationCityId, a.gender, a.creationDate) | ||
) tmp); | ||
|
||
query IIIIIIII | ||
SELECT * FROM result; | ||
---- | ||
Ali Abouba 1987-05-29 41.203.147.168 Internet Explorer 1264 male 2011-05-12 02:46:47.595+00 | ||
|
||
statement ok | ||
-INSERT INTO result (FROM GRAPH_TABLE (snb | ||
MATCH (a is person where a.id = 17592186044461) | ||
COLUMNS(a.firstName, a.lastName, a.birthday, a.locationIP, a.browserUsed, a.LocationCityId, a.gender, a.creationDate) | ||
) tmp) | ||
|
||
query IIIIIIII | ||
SELECT * FROM result; | ||
---- | ||
Ali Abouba 1987-05-29 41.203.147.168 Internet Explorer 1264 male 2011-05-12 02:46:47.595+00 | ||
Ali Abouba 1987-05-29 41.203.147.168 Internet Explorer 1264 male 2011-05-12 02:46:47.595+00 |
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