This topic describes the data types and parameters that GDB Writer supports and how to configure it by using the code editor.
- GDB Writer supports only exclusive resource groups for Data Integration, but not the default resource group or custom resource groups. For more information, see Use exclusive resource groups for data integration and Add a custom resource group.
- You must configure a GDB connection before you configure GDB Writer.
- You must configure two sync nodes to synchronize vertex data and edge data separately.
Limits
- You must run a sync node to synchronize vertex data before you run a sync node to synchronize edge data.
- Limits on vertices:
- A vertex must have a vertex name that is specified by the label parameter.
- A vertex must have a unique primary key of the STRING type. If the primary key is not a string, GDB Writer forcibly converts the primary key to a string.
- Exercise caution when you set the idTransRule parameter. If you set this parameter to None, make sure that the primary key of each vertex is unique among global vertices.
- Limits on edges:
- An edge must have an edge name that is specified by the label parameter.
- The primary key is optional for an edge.
- If you specify a primary key for an edge, make sure that the ID is unique among global edges.
- If no primary key is specified, GDB Writer automatically generates a universally unique identifier (UUID) of the STRING type for the edge. If the UUID is not a string, GDB Writer forcibly converts the UUID to a string.
- Exercise caution when you set the idTransRule parameter. If you set this parameter to None, make sure that the primary key of each edge is unique among global edges.
- The srcIdTransRule and dstIdTransRule parameters are required for an edge, and their values must be the same as the value of the idTransRule parameter of the related vertex.
- Unless otherwise specified, field names and enumerated values in this topic are case-sensitive.
- GDB Writer supports only the UTF-8 encoding format. Source data must be encoded in UTF-8.
- Due to network constraints, sync nodes that are used to synchronize data to GDB databases must be run on exclusive resource groups for Data Integration. You must purchase an exclusive resource group for Data Integration and bind it to the virtual private cloud (VPC) where the GDB instance resides in advance. For more information, see Exclusive resource mode. Scheduling nodes can be run on the default resource group.
Parameters
Parameter | Description | Required | Default value |
---|---|---|---|
datasource | The connection name. It must be the same as the name of the added connection. You can add connections in the code editor. | Yes | N/A |
label | The label, that is, the name of the vertex or edge.
GDB Writer can obtain labels from columns in the source table. For example, if you set this parameter to ${0}, GDB Writer uses the value of the first column as the label. The column index starts from 0. |
Yes | N/A |
labelType | The type of the label. Valid values:
|
Yes | N/A |
srcLabel |
|
No | N/A |
dstLabel |
|
No | N/A |
writeMode | The mode in which GDB Writer processes data records with duplicate primary keys. Valid
values:
|
Yes | INSERT |
idTransRule | The rule for converting the primary key. Valid values:
|
Yes | None |
srcIdTransRule | The rule for converting the primary key of the start vertex when the labelType parameter is set to EDGE. Valid values:
|
Required when the labelType parameter is set to EDGE | None |
dstIdTransRule | The rule for converting the primary key of the end vertex when the labelType parameter is set to EDGE. Valid values:
|
Required when the labelType parameter is set to EDGE. | None |
column | The mappings between the columns in the source and the vertices or edges to be synchronized.
Sample of properties
|
Yes | N/A |
Configure GDB Writer by using the codeless UI
The codeless user interface (UI) is not supported for GDB Writer.
Configure GDB Writer by using the code editor
- Configure a sync node to write vertex data to a GDB database
{ "order":{ "hops":[ { "from":"Reader", "to":"Writer" } ] }, "setting":{ "errorLimit":{ "record":"100" // The maximum number of dirty data records allowed. }, "jvmOption":"", "speed":{ "concurrent":3, "throttle":false } }, "steps":[ { "category":"reader", "name":"Reader", "parameter":{ "column":[ "*" ], "datasource":"_ODPS", "emptyAsNull":true, "guid":"", "isCompress":false, "partition":[], "table":"" }, "stepType":"odps" }, { "category":"writer", "name":"Writer", "parameter": { "datasource": "testGDB", // The connection name. "label": "person", // The label, that is, the name of the vertex. "srcLabel": "", // Use the default setting. "dstLabel": "", // Use the default setting. "labelType": "VERTEX", // The type of the label. A value of VERTEX indicates a vertex. "writeMode": "INSERT", // The mode in which GDB Writer processes data records with duplicate primary keys. "idTransRule": "labelPrefix", // The rule for converting the primary key of the vertex. "srcIdTransRule": "none", // Use the default setting. "dstIdTransRule": "none", // Use the default setting. "column": [ { "name": "id", // The name of the vertex property. "value": "${0}", // The value of the first column in the source is used as the value of the vertex property. If multiple columns are specified, they can be concatenated. In this example, 0 is the column index. "type": "string", // The data type of the vertex property. "columnType": "primaryKey" // The category of the vertex property. A value of primaryKey indicates the primary key. }, // The primary key of the vertex. The value must be an ID of the STRING type, and the record must exist. { "name": "person_age", "value": "${1}", // The value of the second column in the source is used as the value of the vertex property. If multiple columns are specified, they can be concatenated. "type": "int", "columnType": "vertexProperty" // The category of the vertex property. A value of vertexProperty indicates a common vertex property. }, // A common property of the vertex. The value can be of the INT, LONG, FLOAT, DOUBLE, BOOLEAN, or STRING type. { "name": "person_credit", "value": "${2}", // The value of the third column in the source is used as the value of the vertex property. If multiple columns are specified, they can be concatenated. "type": "string", "columnType": "vertexProperty" }, // A common property of the vertex. ] } "stepType":"gdb" } ], "type":"job", "version":"2.0" }
- Configure a sync node to write edge data to a GDB database
{ "order":{ "hops":[ { "from":"Reader", "to":"Writer" } ] }, "setting":{ "errorLimit":{ "record":"100"// The maximum number of dirty data records allowed. }, "jvmOption":"", "speed":{ "concurrent":3, "throttle":false } }, "steps":[ { "category":"reader", "name":"Reader", "parameter":{ "column":[ "*" ], "datasource":"_ODPS", "emptyAsNull":true, "guid":"", "isCompress":false, "partition":[], "table":"" }, "stepType":"odps" }, { "category":"writer", "name":"Writer", "parameter": { "datasource": "testGDB", // The connection name. "label": "use", // The label, that is, the name of the edge. "labelType": "EDGE", // The type of the label. A value of EDGE indicates an edge. "srcLabel": "person", // The name of the start vertex in the edge. "dstLabel": "software", // The name of the end vertex in the edge. "writeMode": "INSERT", // The mode in which GDB Writer processes data records with duplicate primary keys. "idTransRule": "labelPrefix", // The rule for converting the primary key of the edge. "srcIdTransRule": "labelPrefix", // The rule for converting the primary key of the start vertex. "dstIdTransRule": "labelPrefix", // The rule for converting the primary key of the end vertex. "column": [ { "name": "id", // The name of the edge property. "value": "${0}", // The value of the first column in the source is used as the value of the edge property. If multiple columns are specified, they can be concatenated. "type": "string", // The data type of the edge property. "columnType": "primaryKey" // The category of the edge property. A value of primaryKey indicates the primary key. }, // The primary key of the edge. The value must be an ID of the STRING type, and the record must exist. { "name": "id", "value": "${1}", // The value of the second column in the source is used as the value of the edge property. If multiple columns are specified, they can be concatenated. The mapping rule must be the same as that configured when you import the vertex. "type": "string", "columnType": "srcPrimaryKey" // The category of the edge property. The value of srcPrimaryKey indicates the primary key of the start vertex. }, // The primary key of the start vertex. The value must be an ID of the STRING type, and the record must exist. { "name": "id", "value": "${2}", // The value of the third column in the source is used as the value of the edge property. If multiple columns are specified, they can be concatenated. The mapping rule must be the same as that configured when you import the vertex. "type": "string", "columnType": "dstPrimaryKey" // The category of the edge property. A value of dstPrimaryKey indicates the primary key of the end vertex. }, // The primary key of the end vertex. The value must be an ID of the STRING type, and the record must exist. { "name": "person_use_software_time", "value": "${3}", // The value of the fourth column in the source is used as the value of the edge property. If multiple columns are specified, they can be concatenated. "type": "long", "columnType": "edgeProperty" // The category of the edge property. A value of edgeProperty indicates a common edge property. }, // A common property of the edge. The value can be of the INT, LONG, FLOAT, DOUBLE, BOOLEAN, or STRING type. { "name": "person_regist_software_name", "value": "${4}", // The value of the fifth column in the source is used as the value of the edge property. If multiple columns are specified, they can be concatenated. "type": "string", "columnType": "edgeProperty" }, // A common property of the edge. { "name": "id", "value": "${5}", // The value of the sixth column in the source is used as the value of the edge property. If multiple columns are specified, they can be concatenated. "type": "long", "columnType": "edgeProperty" }, // A common property of the edge. The value is an ID. Different from the primary key, this property is optional. ] } "stepType":"gdb" } ], "type":"job", "version":"2.0" }