ldbc / gcore-spark

Implementation of the G-CORE graph query language on Spark
Apache License 2.0
15 stars 5 forks source link

PATH expressions #12

Open peterboncz opened 6 years ago

peterboncz commented 6 years ago

MATCH … -/ pat*/- … ON ( CONSTRUCT g,(src)-[pat]-(dst) MATCH (src)-..pattern…-(dst),.. )

The rewrite for weighted PATH pat = (src)-...pattern..-(dst),...COST ..Y.. used in MATCH … -/ pat* COST x/- … is therefore:

MATCH … -/ pat* COST x/- … ON ( CONSTRUCT g,(src)-[pat {weight:=..Y..}]-(dst) MATCH (src)-..pattern…-(dst),.. )

again, somehow we need to ensure that COST x now gets filled not with the hopcount, but with the SUM(weight). The GraphX implementation already has some support for this, but it needs to be triggered. This extra info is probably best a property attached to the algebra tree nodes, so the GraphX code generation can pick it up and generate the appropriate stuff