Skip to content

Commit

Permalink
Create q10.gsql
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxiw authored Jan 21, 2025
1 parent e5b1d37 commit ccf633b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions demos/guru_scripts/docker/tutorial/4.x/script/q10.gsql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
USE GRAPH financialGraph

CREATE OR REPLACE DISTRIBUTED QUERY q10() SYNTAX V3 {

SumAccum<int> @cnt = 0;

//for each blocked account, find its 1-hop-neighbor who has not been blocked.
tgtAccnts = SELECT y
FROM (x:Account)- [e:transfer] -> (y:Account)
WHERE x.isBlocked == TRUE AND y.isBlocked == FALSE
ACCUM y.@cnt +=1;

// tgtAccnts vertex set drive the query block below. It's placed in the vertex label position.
tgtPhones = SELECT z
FROM (x:tgtAccnts) ~ [e:hasPhone] ~ (z:Phone)
WHERE z.isBlocked
ACCUM z.@cnt +=1;

PRINT tgtPhones;
}

INSTALL QUERY q10

RUN QUERY q10()

0 comments on commit ccf633b

Please sign in to comment.