duckpgq-extension
duckpgq-extension copied to clipboard
Support optional match
Many SNB queries such as IC1, IC4, IC5 (see https://github.com/cwida/duckpgq-experiments/issues/26 for all) require optional matches. The PGQ syntax would be ()-[]->?()
.
Snippet from the SQL/PGQ specification section 10.6:
<questioned path primary> ::=
<path primary> <question mark>
"NOTE 130 — Unlike most regular expression languages,
The way to translate this would be with a LEFT OUTER JOIN
(b:Student)<-[k:Know]-(a:Student)-[sa:studyAt]->?(u:University)
select * from student s
join know k on s.id = k.src
join student s2 on s2.id = k.dst
left join studyat sa on sa.studentid = s.id
join university u on sa.universityid = u.id;
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.