Skip to content

Commit 36f5617

Browse files
committed
add syntax v3 queries
1 parent f751a9c commit 36f5617

File tree

20 files changed

+23
-23
lines changed

20 files changed

+23
-23
lines changed

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-1.gsql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi1(DATETIME date) SYNTAX v3{
3030
ELSE
3131
m.@lengthCategory = 3
3232
END
33-
POST-ACCUM @@midResult += (year(epoch_to_datetime(m.creationDate/1000)), m.@isComment, m.@lengthCategory -> 1, m.length);
33+
POST-ACCUM (m) @@midResult += (year(epoch_to_datetime(m.creationDate/1000)), m.@isComment, m.@lengthCategory -> 1, m.length);
3434

3535
@@result.resize(@@midResult.size());
3636
FOREACH m IN @@midResult DO

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-10.gsql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi10(VERTEX<Person> personId, STRING country
1717
SELECT t
1818
FROM (s:S) -[:KNOWS]- (t:Person)
1919
WHERE NOT t.@visited
20-
POST-ACCUM t.@visited = TRUE;
20+
POST-ACCUM (t) t.@visited = TRUE;
2121
pathLength += 1;
2222
END;
2323
# Here, S is the Person with shortest length of 3
@@ -44,7 +44,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi10(VERTEX<Person> personId, STRING country
4444
FOREACH t IN m.@tags DO
4545
p.@messageCount += (t -> 1)
4646
END
47-
POST-ACCUM
47+
POST-ACCUM (p)
4848
FOREACH (t,cnt) IN p.@messageCount DO
4949
@@result += RESULT(p.id, t.name, cnt)
5050
END;

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-12.gsql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi12(DATETIME startDate, INT lengthThreshold
2121
SELECT p
2222
FROM (:M) -[:HAS_CREATOR]-> (p:Person)
2323
ACCUM p.@messageCount += 1
24-
POST-ACCUM @@personCount += (p.@messageCount -> 1);
24+
POST-ACCUM (p) @@personCount += (p.@messageCount -> 1);
2525

2626
allPersons = {Person.*};
2727
diff = allPersons.size() - persons.size();

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-13.gsql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi13(STRING country, DATETIME endDate) SYNTA
4242

4343
zombies =
4444
SELECT z FROM (z:zombies)
45-
POST-ACCUM
45+
POST-ACCUM (z)
4646
IF z.@totalLikeCount > 0 THEN
4747
@@result += RESULT(z.id, z.@zombieLikeCount, z.@totalLikeCount, 1.0 * z.@zombieLikeCount / z.@totalLikeCount)
4848
ELSE

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-14.gsql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi14(STRING country1, STRING country2) SYNTA
4545
tmp = SELECT p1 FROM (m2:M2) <-[:LIKES]- (p1:Person)
4646
WHERE p1.@valid
4747
ACCUM p1.@p2s3 += m2.@p2s3
48-
POST-ACCUM p1.@p2s3 = (p1.@p2s3 INTERSECT p1.@knows);
48+
POST-ACCUM (p1) p1.@p2s3 = (p1.@p2s3 INTERSECT p1.@knows);
4949

5050
# Case 4
5151
M2 = SELECT m2 FROM (p2:P2) -[:LIKES]-> (m2)
5252
ACCUM m2.@p2s4 += p2;
5353
tmp = SELECT p1 FROM (m2:M2) -[:HAS_CREATOR]-> (p1:Person)
5454
WHERE p1.@valid
5555
ACCUM p1.@p2s4 += m2.@p2s4
56-
POST-ACCUM p1.@p2s4 = (p1.@p2s4 INTERSECT p1.@knows);
56+
POST-ACCUM (p1) p1.@p2s4 = (p1.@p2s4 INTERSECT p1.@knows);
5757

5858
P1 = SELECT p1 FROM (p1:P1)
5959
ACCUM
@@ -63,7 +63,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi14(STRING country1, STRING country2) SYNTA
6363
FOREACH p2 IN p1.@p2s4 DO
6464
p1.@score += (p2 -> 1)
6565
END
66-
POST-ACCUM
66+
POST-ACCUM (p1)
6767
FOREACH (p2,score) IN p1.@score DO
6868
p1.@pScore += ps(p2.id,score)
6969
END;

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-16.gsql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi16(STRING tagA, DATETIME dateA,
4848
persons =
4949
SELECT p
5050
FROM (p:persons)
51-
POST-ACCUM @@result += RESULT(p.id, p.@messageCountA, p.@messageCountB, p.@messageCountA+p.@messageCountB);
51+
POST-ACCUM (p) @@result += RESULT(p.id, p.@messageCountA, p.@messageCountB, p.@messageCountA+p.@messageCountB);
5252

5353
PRINT @@result as result;
5454
}

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-17.gsql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi17(STRING tag, INT delta) SYNTAX v3 {
5454
FROM (m:messages2) -[:REPLY_OF]-> (m2)
5555
WHERE m2.@hasTag AND m.@creator != m2.@creator
5656
ACCUM m2.@Forum1 += (m2.@CreatorForums INTERSECT m.@CreatorForums)
57-
POST-ACCUM m2.@Forum1.remove(m2.@forum)
57+
POST-ACCUM (m2) m2.@Forum1.remove(m2.@forum)
5858
HAVING m2.@Forum1.size() > 0;
5959

6060
message2 =

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-18.gsql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi18(STRING tag) SYNTAX v3 {
2323
FROM (p1:person1) -[:KNOWS]- (:Person) -[:KNOWS]- (p2:Person)
2424
WHERE p2.@hasInterest AND NOT p2.@exclude.contains(p1)
2525
ACCUM p2.@mutualFriendCount += (p1 -> 1)
26-
POST-ACCUM
26+
POST-ACCUM (p2)
2727
FOREACH (p,num) IN p2.@mutualFriendCount DO
2828
@@result += RESULT(p.id, p2.id, num)
2929
END;

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-2.gsql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi2(DATETIME date, STRING tagClass) SYNTAX v
2323
ELSE
2424
t.@countWindow2 += 1
2525
END
26-
POST-ACCUM
26+
POST-ACCUM (t)
2727
@@result += RESULT(t.name, t.@countWindow1, t.@countWindow2, abs(t.@countWindow1 - t.@countWindow2));
2828

2929
tmp =

tools/ldbc_benchmark/tigergraph/queries/business_intelligence/syntax_v3/bi-3.gsql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CREATE OR REPLACE DISTRIBUTED QUERY bi3(STRING tagClass, STRING country) SYNTAX
2727
FROM (p:posts) <-[:CONTAINER_OF]- (f:Forum)
2828
WHERE f.@selected
2929
ACCUM f.@messageCount += p.@messageCount
30-
POST-ACCUM @@result += RESULT(f.id, f.title, ms_to_string(f.creationDate), f.@personId, f.@messageCount);
30+
POST-ACCUM (f) @@result += RESULT(f.id, f.title, ms_to_string(f.creationDate), f.@personId, f.@messageCount);
3131

3232
PRINT @@result as result;
3333
}

0 commit comments

Comments
 (0)