From 916138ec9d2df114e34e9a795d8e547d4fb769ef Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 21:12:01 +0100 Subject: [PATCH 01/16] Add ColumnsOptional --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index 41b0c620..666802af 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit 41b0c620af902163fea49351527b2acced3fea52 +Subproject commit 666802aff29110d312b22359b04835ede68afa15 From 78528df1d8d1890b8128239623db2726390d4f80 Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 21:12:37 +0100 Subject: [PATCH 02/16] Add type of ColumnsOptional --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index 666802af..09a473dd 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit 666802aff29110d312b22359b04835ede68afa15 +Subproject commit 09a473dd1ca7d4cf2d6995ac6be5babb07dc4e5e From 6229c9447ea968133c3ab30c3a0c71a7540539cb Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 21:54:53 +0100 Subject: [PATCH 03/16] Enable unrelated test --- test/sql/path-finding/subpath_match.test | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 From fe3095553012a743fbd0c8bc3aaf9505ce637dde Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 21:55:31 +0100 Subject: [PATCH 04/16] Add test cases --- test/sql/optional_columns.test | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/sql/optional_columns.test diff --git a/test/sql/optional_columns.test b/test/sql/optional_columns.test new file mode 100644 index 00000000..bb6cd740 --- /dev/null +++ b/test/sql/optional_columns.test @@ -0,0 +1,55 @@ +# 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 +-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 \ No newline at end of file From 67a12789eed52bb2092f30970dd0a8d08779f187 Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 21:55:41 +0100 Subject: [PATCH 05/16] Add transformer logic --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index 09a473dd..5fd2dec7 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit 09a473dd1ca7d4cf2d6995ac6be5babb07dc4e5e +Subproject commit 5fd2dec7271a814933f5b468f5ab61f5f9bc149e From 7691b67cc72e4b68b9169b3858ac53bee05c3a33 Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 21:57:57 +0100 Subject: [PATCH 06/16] Add outer select test case --- test/sql/optional_columns.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sql/optional_columns.test b/test/sql/optional_columns.test index bb6cd740..104503ce 100644 --- a/test/sql/optional_columns.test +++ b/test/sql/optional_columns.test @@ -41,7 +41,7 @@ query I 8796093022237 query I --FROM GRAPH_TABLE (snb MATCH (p:Person) COLUMNS (p.id as p_id)) limit 10; +-SELECT p_id FROM GRAPH_TABLE (snb MATCH (p:Person) COLUMNS (p.id as p_id)) limit 10; ---- 14 16 From 57f8470967d69778efe806c8ff490d5156ebd8ad Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 21:58:10 +0100 Subject: [PATCH 07/16] Add alias test case --- test/sql/optional_columns.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/sql/optional_columns.test b/test/sql/optional_columns.test index 104503ce..a8c396e5 100644 --- a/test/sql/optional_columns.test +++ b/test/sql/optional_columns.test @@ -52,4 +52,18 @@ query I 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 \ No newline at end of file From 859c4f57e29a890b461bfc1739554c182eecc555 Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 22:11:01 +0100 Subject: [PATCH 08/16] Fix bug with multiple columns --- test/sql/optional_columns.test | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/sql/optional_columns.test b/test/sql/optional_columns.test index a8c396e5..10b3d621 100644 --- a/test/sql/optional_columns.test +++ b/test/sql/optional_columns.test @@ -66,4 +66,18 @@ query I 4398046511139 6597069766702 8796093022234 -8796093022237 \ No newline at end of file +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 From 53b873f5e8930befb8d471b0241ef8c5203e513c Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 22:11:03 +0100 Subject: [PATCH 09/16] Fix bug with multiple columns --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index 5fd2dec7..0aa22a1d 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit 5fd2dec7271a814933f5b468f5ab61f5f9bc149e +Subproject commit 0aa22a1d0abe3a380e57a3c7916ab0bad7b660fb From f4006c0c0429804e1da378b57a1ddd3bc17b1542 Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 22:12:39 +0100 Subject: [PATCH 10/16] Comment out unused rules --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index 0aa22a1d..b350f25d 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit 0aa22a1d0abe3a380e57a3c7916ab0bad7b660fb +Subproject commit b350f25d271277a5c2b39fc297f5442642770add From a1b5df30b314600f9f5fea2fa7c90aefd84b0bf2 Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Sat, 2 Mar 2024 22:27:41 +0100 Subject: [PATCH 11/16] Remove commented code --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index b350f25d..71874ff8 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit b350f25d271277a5c2b39fc297f5442642770add +Subproject commit 71874ff8d3c6f487c1ea4f69128c97f223e4253c From fce3814eb2db1366d86299670262736bb3825e95 Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Mon, 4 Mar 2024 09:42:39 +0100 Subject: [PATCH 12/16] Revert old ColumnSpec and ColumnList, but leave commented --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index 71874ff8..a2a282da 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit 71874ff8d3c6f487c1ea4f69128c97f223e4253c +Subproject commit a2a282dace18507604931bc1eb587b5eac980e6f From 468f0c3cb7a611fc7bc3f1eef74631e64d4ea96f Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Mon, 4 Mar 2024 09:44:18 +0100 Subject: [PATCH 13/16] Format fix and generate new parser --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index a2a282da..eedb60d3 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit a2a282dace18507604931bc1eb587b5eac980e6f +Subproject commit eedb60d39534622c96421a0dd6e6a5a069f5ffd6 From fd7ddfeafc4b33a029177151b732e06c352743fa Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Mon, 4 Mar 2024 09:45:17 +0100 Subject: [PATCH 14/16] Format fix --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index eedb60d3..b4c96a02 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit eedb60d39534622c96421a0dd6e6a5a069f5ffd6 +Subproject commit b4c96a022fb06b69b588f51fd6e6baad96b7a491 From 6755a5e82dfd3e6998778864d506ecf4262b5465 Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Mon, 4 Mar 2024 09:46:40 +0100 Subject: [PATCH 15/16] Make format parser consistent --- duckdb-pgq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb-pgq b/duckdb-pgq index b4c96a02..bb9b8207 160000 --- a/duckdb-pgq +++ b/duckdb-pgq @@ -1 +1 @@ -Subproject commit b4c96a022fb06b69b588f51fd6e6baad96b7a491 +Subproject commit bb9b8207158323821eb5f5cce7e00530d3f2ab7a From 7aac01b3600010f6b74c53156171aad08b537a14 Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Mon, 4 Mar 2024 09:54:42 +0100 Subject: [PATCH 16/16] Adding a test with group by --- test/sql/optional_columns.test | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/sql/optional_columns.test b/test/sql/optional_columns.test index 10b3d621..c5a2ce45 100644 --- a/test/sql/optional_columns.test +++ b/test/sql/optional_columns.test @@ -41,7 +41,7 @@ query I 8796093022237 query I --SELECT p_id FROM GRAPH_TABLE (snb MATCH (p:Person) COLUMNS (p.id as p_id)) limit 10; +-SELECT p_id FROM GRAPH_TABLE (snb MATCH (p:Person) COLUMNS (p.id as p_id,)) limit 10; ---- 14 16 @@ -81,3 +81,8 @@ query II 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