cwida / duckpgq-extension

DuckDB extension that adds support for SQL/PGQ
https://duckpgq.notion.site/b8ac652667964f958bfada1c3e53f1bb?v=3b47a8d44bdf4e0c8b503bf23f1b76f2
MIT License
86 stars 7 forks source link

Make COLUMNS clause optional #56

Closed Dtenwolde closed 8 months ago

Dtenwolde commented 1 year ago

Currently the SELECT * is optional for DuckDB's parser. I think it would be also good to make the COLUMNS clause optional. Such that the following queries are equivalent:

SELECT a.id, b.id
FROM GRAPH_TABLE(snb MATCH (a:Person)-[k:knows]->(b:Person))
FROM GRAPH_TABLE(snb MATCH (a:Person)-[k:knows]->(b:Person) COLUMNS(a.id, b.id))

See section 7.1 point a of the SQL/PGQ specifications

This could tie in with making the variable name at the end of the GRAPH_TABLE clause optional (would need to be another issue)

Dtenwolde commented 1 year ago

How should things like ELEMENT_ID(a) be handled if they are in the outer SELECT.