-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathddl_all.gsql
47 lines (31 loc) · 986 Bytes
/
ddl_all.gsql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
DROP ALL
CREATE VERTEX v1 (PRIMARY_ID id INT, name STRING)
CREATE VERTEX v2 (PRIMARY_ID id INT, name STRING)
CREATE UNDIRECTED EDGE e1 (FROM v1, TO v2)
CREATE GRAPH test (v1, v2, e1)
BEGIN
CREATE QUERY test1(/* Parameters here */) FOR GRAPH test {
start = {v1.*};
res =
SELECT trg
FROM start:src -(e1:e)- v2:trg;
PRINT res;
}
END
INSTALL QUERY test1
DROP DATA_SOURCE s3ds2
CREATE DATA_SOURCE S3 s3ds2 = "{\"file.reader.settings.fs.s3a.access.key\":\"{$ACCESS_KEY}\",\"file.reader.settings.fs.s3a.secret.key\":\"{$SECRET_KEY}\"}" FOR GRAPH test
DROP JOB s3lj1
BEGIN
CREATE LOADING JOB s3lj1 FOR GRAPH test {
DEFINE FILENAME f = "$s3ds2:{\"file.uris\":\"s3://tg-workshop-2020-10-04/newdata.csv\"}";
LOAD f
TO VERTEX v1 VALUES($2, $2)
, TO VERTEX v2 VALUES($6, $6)
, TO EDGE e1 VALUES($2, $6)
USING SEPARATOR=","
, HEADER="true"
, EOL="\n";
}
END
RUN LOADING JOB s3lj1 USING EOF="true"