Skip to content

Commit af91efd

Browse files
authored
DOC-2947: Moved images to GitHub for the Accumulators Tutorial page [3.6]
1 parent cf709ee commit af91efd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/tutorials/pages/accumulators-tutorial.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This short tutorial aims to shorten the learning curve of accumulator. Supposedl
1010
== *What is an Accumulator?*
1111

1212
.The left box is a GSQL query with different accumulators being accumulated to. The right box shows the accumulator variables' final results.
13-
image::https://lh3.googleusercontent.com/TZfcbUMlXsHvCYVO_ex9QqjlK823ybyrX7aQhv38j35fghJVpsJEtdFBjcjMj1x2pHfHbNUraTgbySriMRttCuNv359iOwnRHDVcRgPyAj9tQLappYXe6ManjmRS27eunYMc2rjG[Screenshots of the console showing accumulators and their results.]
13+
image::accumulator-examples.png[Screenshots of the console showing accumulators and their results.]
1414

1515
An accumulator is a state variable in GSQL. Its state is mutable throughout the life cycle of a query. It has an initial value, and users can keep accumulating (using its "+=" built-in operator) new values into it. Each accumulator variable has a type. The type decides what semantics the declared accumulator will use to interpret the "+=" operation.
1616

@@ -33,13 +33,13 @@ Global accumulator belongs to the entire query. Anywhere in a query, a statement
3333
* *@* prefix is used for declaring local accumulator variable. It must be used with a vertex alias in a query block. E.g. `v.@cnt += 1,` where v is a vertex alias specified in a FROM clause of a SELECT-FROM-WHERE query block.
3434

3535
.A Social graph with 7 Person vertices and 7 Friendship edges connecting them.
36-
image::https://lh6.googleusercontent.com/zBXxBe-6iSKX2RJZ9ITyC1wLf-gcbuJbzHlqnGCFV6uwjkYHrTYXtW56HzAn2uA-YYw4TQNt2-MFe-nbGXDnNml0K1sRYVdAKlc3SxMYZ5UsRnlWTb4R-fHIcXJillIGsyffAO2H[]
36+
image::friendship-social-graph.png[]
3737

3838
Consider a toy social graph modeled by a person vertex type and a person-to-person friendship edge type shown in Figure 2. Below we write a query, which accepts a person, and does a 1-hop traversal from the input person to its neighbors. We use the @@global_edge_cnt accumulator to accumulate the total number of edges we traverse. And we use @vertex_cnt to write to the input person's each friend vertex an integer 1.
3939

40-
image::https://lh5.googleusercontent.com/6PVg2z_7N7SqnLUeZOP2mdh52KQqB_GCZC-x5A6edcAagOWqBKWRPixykP-wS-tnAAqPYBWZbEBQOTHqV1GghvlsObYEW5tLkZ-Nn0lIc0EsAk8_RZRP_-vZQnsNn2Wy-j4sB-e4[]
40+
image::global-vertex-accumulators-query.png[]
4141

42-
image::https://lh4.googleusercontent.com/P8rs2ukMPxoFJKk1x74FNkEa38PTg-KNcC9uJ_BN4ZRcYh5nhDTcjYD4_ajvgBe047-hLRaUbHfMXdEnn2nLzFQXGkRHRBbVb4lY399yZ_7If25HKtCAO0Hymn35Zm5fxdux_YtV[Figure 3. The top box shows a query that given a person, accumulate the edge count into @@global_edge_cnt. The bottom box shows that for each friend of the input person, we accumulate 1 into its @vertex_cnt. ]
42+
image::query-output-neighbors.png[Figure 3. The top box shows a query that given a person, accumulate the edge count into @@global_edge_cnt. The bottom box shows that for each friend of the input person, we accumulate 1 into its @vertex_cnt.]
4343

4444
As Figure 2 shows, Dan has 4 direct friends -- Tom, Kevin, Jenny, and Nancy, each of which holds a local accumulator @vertex_cnt. And the @@global_edge_cnt has value 4, reflecting the fact that for each edge, we have accumulated 1 into it.
4545

0 commit comments

Comments
 (0)