From 24a25fa25a1d164ba7849def278b8ab6f248767d Mon Sep 17 00:00:00 2001 From: Zhang Lei Date: Tue, 30 Jan 2024 17:54:26 +0800 Subject: [PATCH] docs(interactive): Update doc (#3514) --- docs/flex/interactive/custom_graph_data.md | 2 +- docs/flex/interactive/data_import.md | 87 +++++++++++++++++++++- 2 files changed, 87 insertions(+), 2 deletions(-) diff --git a/docs/flex/interactive/custom_graph_data.md b/docs/flex/interactive/custom_graph_data.md index 2e29a6396c4a..e9ed80a3801d 100644 --- a/docs/flex/interactive/custom_graph_data.md +++ b/docs/flex/interactive/custom_graph_data.md @@ -137,7 +137,7 @@ The `import.yaml` file maps raw data fields to the schema of the "modern" graph graph: movies loading_config: data_source: - scheme: file # file, oss, s3, hdfs; only file is supported now + scheme: file # only file and odps is supported now location: /home/graphscope/movies/ import_option: init # append, overwrite, only init is supported now format: diff --git a/docs/flex/interactive/data_import.md b/docs/flex/interactive/data_import.md index a1451e177a5c..e0d2ae7abdeb 100644 --- a/docs/flex/interactive/data_import.md +++ b/docs/flex/interactive/data_import.md @@ -6,7 +6,7 @@ In our guide on [using custom graph data](./custom_graph_data.md), we introduced Currently we only support import data to graph from local `csv` files or `odps` table. See configuration `loading_config.data_source.scheme`. -## Sample Configuration for the "Modern" Graph +## Sample Configuration for loading "Modern" Graph from csv files To illustrate, let's examine the `examples/modern_import_full.yaml` file. This configuration is designed for importing the "modern" graph and showcases the full range of configuration possibilities. We'll dissect each configuration item in the sections that follow. @@ -98,6 +98,91 @@ edge_mappings: property: weight ``` +## Sample configuration for loading "Modern Graph" from odps tables + +```yaml +graph: dd_graph +loading_config: + data_source: + scheme: odps # file, odps + import_option: init # init, overwrite + format: + type: arrow +vertex_mappings: + - type_name: person # must align with the schema + inputs: + - your_proj_name/table_name/partition_col_name=paritition_name + column_mappings: + - column: + index: 0 + name: id + property: id + - column: + index: 1 + name: name + property: name + - column: + index: 2 + name: age + property: age + - type_name: software + inputs: + - your_proj_name/table_name/partition_col_name=paritition_name + column_mappings: + - column: + index: 0 + name: id + property: id + - column: + index: 1 + name: name + property: name + - column: + index: 2 + name: lang + property: lang +edge_mappings: + - type_triplet: + edge: knows + source_vertex: person + destination_vertex: person + inputs: + - your_proj_name/table_name/partition_col_name=paritition_name + source_vertex_mappings: + - column: + index: 0 + name: src_user_id + property: id + destination_vertex_mappings: + - column: + index: 1 + name: dst_user_id + property: id + column_mappings: + - column: + index: 2 + name: weight + property: weight + - type_triplet: + edge: created + source_vertex: person + destination_vertex: software + inputs: + - your_proj_name/table_name/partition_col_name=paritition_name + source_vertex_mappings: + - column: + index: 0 + name: id + destination_vertex_mappings: + - column: + index: 1 + name: id + column_mappings: + - column: + index: 2 + name: weight + property: weight +``` ## Configuration Breakdown The table below offers a detailed breakdown of each configuration item. In this table, we use the "." notation to represent the hierarchy within the YAML structure.