-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
USE GRAPH financialGraph | ||
|
||
CREATE OR REPLACE DISTRIBUTED QUERY q11() SYNTAX V3 { | ||
|
||
SumAccum<int> @cnt = 0; | ||
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, @@cnt +=1; | ||
|
||
// tgtAccnts vertex set drive the query block below | ||
tgtPhones = SELECT z | ||
FROM (x:tgtAccnts)- [e:hasPhone] - (z:Phone) | ||
WHERE z.isBlocked AND x.@cnt >1 AND @@cnt>0 | ||
ACCUM z.@cnt +=1; | ||
|
||
PRINT tgtPhones; | ||
} | ||
|
||
|
||
INSTALL QUERY q11 | ||
|
||
|
||
RUN QUERY q11() |