You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by jo...@apache.org on 2021/10/21 20:10:12 UTC
[incubator-age-website] branch master updated: Added Data Creation
Download Script for Aggregates
This is an automated email from the ASF dual-hosted git repository.
joshinnis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-age-website.git
The following commit(s) were added to refs/heads/master by this push:
new fcf57d6 Added Data Creation Download Script for Aggregates
fcf57d6 is described below
commit fcf57d64c269f246476c1255a19396b5780fa60f
Author: Josh Innis <Jo...@gmail.com>
AuthorDate: Thu Oct 21 13:09:39 2021 -0700
Added Data Creation Download Script for Aggregates
---
docs/functions/aggregate_functions.md | 3 ++-
docs/scripts/functions/aggregation_setup.sql | 18 ++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/docs/functions/aggregate_functions.md b/docs/functions/aggregate_functions.md
index 4d62053..d08f0cf 100644
--- a/docs/functions/aggregate_functions.md
+++ b/docs/functions/aggregate_functions.md
@@ -1,5 +1,6 @@
# Aggregation Functions
+<a href="../scripts/functions/aggregation_setup.sql">Data Setup Script</a>
## min()
@@ -65,7 +66,7 @@ Result:
</td>
</tr>
<tr>
- <td>21
+ <td>2123e1af756543542064ae0d07792be90176b311be
</td>
</tr>
<tr>
diff --git a/docs/scripts/functions/aggregation_setup.sql b/docs/scripts/functions/aggregation_setup.sql
new file mode 100644
index 0000000..4c97da4
--- /dev/null
+++ b/docs/scripts/functions/aggregation_setup.sql
@@ -0,0 +1,18 @@
+
+LOAD 'age';
+SET search_path TO ag_catalog;
+
+SELECT create_graph('graph_name');
+
+SELECT * FROM cypher('graph_name', $$
+ CREATE (a:Person {name: 'A', age: 13}),
+ (b:Person {name: 'B', age: 33, eyes: "blue"}),
+ (c:Person {name: 'C', age: 44, eyes: "blue"}),
+ (d1:Person {name: 'D', eyes: "brown"}),
+ (d2:Person {name: 'D'}),
+ (a)-[:KNOWS]->(b),
+ (a)-[:KNOWS]->(c),
+ (a)-[:KNOWS]->(d1),
+ (b)-[:KNOWS]->(d2),
+ (c)-[:KNOWS]->(d2)
+$$) as (a agtype);