Skip to content

Commit 40ab664

Browse files
committed
docs: Add Parquet example
1 parent a8d4894 commit 40ab664

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

pages/data-migration/parquet.mdx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ of a single label or relationships of a single type.
141141

142142
<Steps>
143143

144-
{<h3 className="custom-header">Download the files</h3>}
144+
{<h3 className="custom-header">Parquet files</h3>}
145145

146-
- [`people_nodes.parquet`](https://public-assets.memgraph.com/import-data/load-csv-cypher/multiple-types-nodes/people_nodes.parquet) is used to create nodes labeled `:Person`.<br/> The file contains the following data:
146+
- [`people_nodes.parquet`](s3://download.memgraph.com/asset/docs/people_nodes.parquet) is used to create nodes labeled `:Person`.<br/> The file contains the following data:
147147
```parquet
148148
id,name,age,city
149149
100,Daniel,30,London
@@ -152,7 +152,7 @@ of a single label or relationships of a single type.
152152
103,Mia,25,Zagreb
153153
104,Lucy,21,Paris
154154
```
155-
- [`restaurants_nodes.parquet`](https://public-assets.memgraph.com/import-data/load-csv-cypher/multiple-types-nodes/restaurants_nodes.parquet) is used to create nodes labeled `:Restaurants`.<br/> The file contains the following data:
155+
- [`restaurants_nodes.parquet`](s3://download.memgraph.com/asset/docs/restaurants_nodes.parquet) is used to create nodes labeled `:Restaurants`.<br/> The file contains the following data:
156156
```parquet
157157
id,name,menu
158158
200,Mc Donalds,Fries;BigMac;McChicken;Apple Pie
@@ -161,7 +161,7 @@ of a single label or relationships of a single type.
161161
203,Dominos,Pepperoni Pizza;Double Dish Pizza;Cheese filled Crust
162162
```
163163

164-
- [`people_relationships.parquet`](https://public-assets.memgraph.com/import-data/load-csv-cypher/multiple-types-nodes/people_relationships.parquet) is used to connect people with the `:IS_FRIENDS_WITH` relationship.<br/> The file contains the following data:
164+
- [`people_relationships.parquet`](s3://download.memgraph.com/asset/docs/people_relationships.parquet) is used to connect people with the `:IS_FRIENDS_WITH` relationship.<br/> The file contains the following data:
165165
```parquet
166166
first_person,second_person,met_in
167167
100,102,2014
@@ -172,7 +172,7 @@ of a single label or relationships of a single type.
172172
101,102,2017
173173
100,103,2001
174174
```
175-
- [`restaurants_relationships.parquet`](https://public-assets.memgraph.com/import-data/load-csv-cypher/multiple-types-nodes/restaurants_relationships.parquet) is used to connect people with restaurants using the `:ATE_AT` relationship.<br/> The file contains the following data:
175+
- [`restaurants_relationships.parquet`](s3://download.memgraph.com/asset/docs/restaurants_relationships.parquet) is used to connect people with restaurants using the `:ATE_AT` relationship.<br/> The file contains the following data:
176176
```parquet
177177
PERSON_ID,REST_ID,liked
178178
100,200,true
@@ -184,28 +184,23 @@ of a single label or relationships of a single type.
184184
102,201,true
185185
```
186186

187-
{<h3 className="custom-header">Check the location of the Parquet files</h3>}
188-
If you are working with Docker, [copy the files from your local directory into
189-
the Docker container](/getting-started/first-steps-with-docker#copy-files-from-and-to-a-docker-container)
190-
so that Memgraph can access them.
191-
192187
{<h3 className="custom-header">Import nodes</h3>}
193188

194189
Each row will be parsed as a map, and the
195-
fields can be accessed using the property lookup syntax (e.g. `id: row.id`).
190+
fields can be accessed using the property lookup syntax (e.g. `id: row.id`). Files can be imported directly from s3 or can be downloaded and then accessed from the local disk.
196191

197192
The following query will load row by row from the file, and create a new node
198193
for each row with properties based on the parsed row values:
199194

200195
```cypher
201-
LOAD PARQUET FROM "/path-to/people_nodes_wh.parquet" AS row
196+
LOAD PARQUET FROM "s3://download.memgraph.com/asset/docs/people_nodes.parquet" AS row
202197
CREATE (n:Person {id: row.id, name: row.name, age: row.age, city: row.city});
203198
```
204199

205200
In the same manner, the following query will create new nodes for each restaurant:
206201

207202
```cypher
208-
LOAD PARQUET FROM "/path-to/restaurants_nodes.parquet" AS row
203+
LOAD PARQUET FROM "s3://download.memgraph.com/asset/docs/restaurants_nodes.parquet" AS row
209204
CREATE (n:Restaurant {id: row.id, name: row.name, menu: row.menu});
210205
```
211206

@@ -223,7 +218,7 @@ of a single label or relationships of a single type.
223218
The following query will create relationships between the people nodes:
224219

225220
```cypher
226-
LOAD PARQUET FROM "/path-to/people_relationships.parquet" AS row
221+
LOAD PARQUET FROM "s3://download.memgraph.com/asset/docs/people_relationships.parquet" AS row
227222
MATCH (p1:Person {id: row.first_person})
228223
MATCH (p2:Person {id: row.second_person})
229224
CREATE (p1)-[f:IS_FRIENDS_WITH]->(p2)
@@ -233,7 +228,7 @@ of a single label or relationships of a single type.
233228
The following query will create relationships between people and restaurants where they ate:
234229

235230
```cypher
236-
LOAD PARQUET FROM "/path-to/restaurants_relationships.parquet" AS row
231+
LOAD PARQUET FROM "s3://download.memgraph.com/asset/docs/restaurants_relationships.parquet" AS row
237232
MATCH (p1:Person {id: row.PERSON_ID})
238233
MATCH (re:Restaurant {id: row.REST_ID})
239234
CREATE (p1)-[ate:ATE_AT]->(re)

0 commit comments

Comments
 (0)