Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: acezen <[email protected]>
  • Loading branch information
acezen committed Mar 13, 2024
1 parent 37c53dc commit e516643
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions docs/storage_engine/graphar.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,18 @@ GraphScope provides a set of APIs to load and archive graph data in GraphAr form

### Saving Graph Data in GraphAr

You can save a graph in GraphAr format using the `save_to` function. Here's an example:
You can save a graph in GraphAr format using the `save_to` function.

`save_to` supports the following GraphAr related parameters:

- **graphar_graph_name**: The name of the graph, default is "graph".
- **graphar_file_type**: The file type of the graph data, including "csv", "orc", "parquet". default is "parquet".
- **graphar_vertex_chunk_size**: The chunk size of the vertex data in graphar format, default is 2^18.
- **graphar_edge_chunk_size**: The chunk size of the edge data in graphar format, default is 2^22.
- **graphar_store_in_local**: Whether to make each worker store the part of the graph data in local file system, default is False.
- **selector**: The selector to select the subgraph to save, if not specified, the whole graph will be saved.

Here's an example:

```python
import graphscope
Expand All @@ -85,6 +96,8 @@ r = g.save_to(
format="graphar",
graphar_graph_name="ldbc", # the name of the graph
graphar_file_type="parquet", # the file type of the graph data
graphar_vertex_chunk_size=1024, # the chunk size of the vertex data
graphar_edge_chunk_size=4096, # the chunk size of the edge data
)
# the result is a dictionary that contains the format and the URI path of the saved graph
print(r)
Expand Down Expand Up @@ -123,6 +136,8 @@ r = g.save_to(
selector=selector,
graphar_graph_name="ldbc_subgraph", # the name of the graph
graphar_file_type="parquet", # the file type of the graph data
graphar_vertex_chunk_size=1024, # the chunk size of the vertex data
graphar_edge_chunk_size=4096, # the chunk size of the edge data
)
# the result is a dictionary that contains the format and the URI path of the saved graph
print(r)
Expand All @@ -131,7 +146,13 @@ print(r)

### Loading GraphAr Data into GraphScope

You can load a graph from GraphAr format data using the `load_from` function. Here's an example:
You can load a graph from GraphAr format data using the `load_from` function.

`load_from` supports the following GraphAr related parameters:
- **graphar_store_in_local**: Whether the graph data is stored in the local file system of each worker, default is False.
- **selector**: The selector to select the subgraph to load, if not specified, the whole graph will be loaded.

Here's an example:


```python
Expand Down

0 comments on commit e516643

Please sign in to comment.