From e516643a5aca6d2ec602028d2a9f648278efac09 Mon Sep 17 00:00:00 2001 From: acezen Date: Wed, 13 Mar 2024 20:40:58 +0800 Subject: [PATCH] Update Signed-off-by: acezen --- docs/storage_engine/graphar.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/storage_engine/graphar.md b/docs/storage_engine/graphar.md index b3acadcf7005..8e0e85466fa6 100644 --- a/docs/storage_engine/graphar.md +++ b/docs/storage_engine/graphar.md @@ -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 @@ -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) @@ -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) @@ -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