diff --git a/duckdb-pgq b/duckdb-pgq index 41b0c620..bb9b8207 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit 41b0c620af902163fea49351527b2acced3fea52 +Subproject commit bb9b8207158323821eb5f5cce7e00530d3f2ab7a diff --git a/test/sql/optional_columns.test b/test/sql/optional_columns.test new file mode 100644 index 00000000..c5a2ce45 --- /dev/null +++ b/test/sql/optional_columns.test @@ -0,0 +1,88 @@ +# name: test/sql/sqlpgq/snb.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, + Organisation LABEL Organisation IN typemask(company, university) + ) +EDGE TABLES ( + Person_knows_person SOURCE KEY (Person1Id) REFERENCES Person (id) + DESTINATION KEY (Person2Id) REFERENCES Person (id) + LABEL Knows, + person_workAt_Organisation SOURCE KEY (PersonId) REFERENCES Person (id) + DESTINATION KEY (OrganisationId) REFERENCES Organisation (id) + LABEL workAt_Organisation + ); + +query IIIIIIIIIII +-FROM GRAPH_TABLE (snb MATCH (p:Person)) limit 1; +---- +2010-01-03 23:10:31.499+00 14 Hossein Forouhar male 1984-03-11 77.245.239.11 Firefox 1166 fa;ku;en Hossein14@hotmail.com + +query I +-FROM GRAPH_TABLE (snb MATCH (p:Person) COLUMNS (p.id)) limit 10; +---- +14 +16 +32 +2199023255557 +2199023255573 +2199023255594 +4398046511139 +6597069766702 +8796093022234 +8796093022237 + +query I +-SELECT p_id FROM GRAPH_TABLE (snb MATCH (p:Person) COLUMNS (p.id as p_id,)) limit 10; +---- +14 +16 +32 +2199023255557 +2199023255573 +2199023255594 +4398046511139 +6597069766702 +8796093022234 +8796093022237 + +query I +-FROM GRAPH_TABLE (snb MATCH (p:Person) COLUMNS (p.id as p_id)) limit 10; +---- +14 +16 +32 +2199023255557 +2199023255573 +2199023255594 +4398046511139 +6597069766702 +8796093022234 +8796093022237 + +query II +-FROM GRAPH_TABLE (snb MATCH (p:Person) COLUMNS (p.id, p.firstname as first_name)) limit 10; +---- +14 Hossein +16 Jan +32 Miguel +2199023255557 Eric +2199023255573 Arbaaz +2199023255594 Ali +4398046511139 Ayesha +6597069766702 Alejandro +8796093022234 Rahul +8796093022237 Lei + +query I +-SELECT count(*) FROM GRAPH_TABLE (snb MATCH (p:Person)) GROUP BY ALL limit 10; +---- +50 \ No newline at end of file diff --git a/test/sql/path-finding/subpath_match.test b/test/sql/path-finding/subpath_match.test index 1e8d7527..c77d0efb 100644 --- a/test/sql/path-finding/subpath_match.test +++ b/test/sql/path-finding/subpath_match.test @@ -32,16 +32,16 @@ EDGE TABLES ( PROPERTIES ( id ) LABEL Knows ); -#query II -#-SELECT study.a_id, study.name -#FROM GRAPH_TABLE (pg -# MATCH -# (a:Person WHERE a.id = 0) -# COLUMNS (a.id as a_id, a.name) -# ) study -#---- -#0 Daniel -# +query II +-SELECT study.a_id, study.name +FROM GRAPH_TABLE (pg + MATCH + (a:Person WHERE a.id = 0) + COLUMNS (a.id as a_id, a.name) + ) study +---- +0 Daniel + #query II #-SELECT study.a_id, study.b_id #FROM GRAPH_TABLE (pg