Source: https://dev-docs.nebula-graph.io/v5.3.2/clients/spark-connector/config/spark-options/ Documentation version: v5.3.2 # Configuration classes Use these classes to configure Spark read and write operations for NebulaGraph Database Developer Edition: - `NebulaConnectionConfig`: used to connect to NebulaGraph Database Developer Edition. - `WriteNebulaNodeConfig`: used to write nodes to NebulaGraph Database Developer Edition. - `WriteNebulaEdgeConfig`: used to write edges to NebulaGraph Database Developer Edition. - `ReadNebulaConfig`: used to read data from NebulaGraph Database Developer Edition. ## `NebulaConnectionConfig` | Method | Description | Required | Default value | Data type | Introduced in | `withGraphAddress` | The IP address and port of the Graph service. Separate multiple entries with commas (,). For example: `ip1:port1,ip2:port2,...` | Yes | N/A | String | 5.0 | `withUser` | The username of the Graph service. | Yes | N/A | String | 5.0 | `withPasswd` | The password used to authenticate a user. | Yes | N/A | String | 5.0 | `withTimeoutSec` | The connection timeout for read and write requests in seconds. | No | 5 | Integer | 5.0 | `withPingTimeoutSec` | The timeout for pinging the Graph service in seconds. | No | 3 | Integer | 5.2 | `withExecuteRetry` | The number of retries when a connection fails. | No | 3 | Integer | 5.0 | `withExecuteRetryIntervalMs` | The interval between retries in milliseconds. | No | 0 | Integer | 5.0 | `withEnableTls` | Whether to enable TLS encryption. | No | false | Boolean | 5.1 | `withDisableVerifyServerCert` | Whether to disable server certificate verification. | No | false | Boolean | 5.1 | `withTlsCaPath` | The path to the CA (Certificate Authority) certificate file, which is used to verify the server's certificate. Required if `withEnableTls` is set to `true` and `withDisableVerifyServerCert` is set to `false`. | No | N/A | String | 5.1 | `withTlsCertPath` | The path to the certificate file of the client. Required if `tls_client_verify` is set to `true` in the configuration file of NebulaGraph Database Developer Edition's Graph service. | No | N/A | String | 5.1 | `withTlsKeyPath` | The path to the private key file of the client. Required if `tls_client_verify` is set to `true` in the configuration file of NebulaGraph Database Developer Edition's Graph service. | No | N/A | String | 5.1 ## `WriteNebulaNodeConfig` | Method | Description | Required | Default value | Data type | Introduced in | `withGraphName` | The name of the graph to which data is written. | Yes | N/A | String | 5.0 | `withSchema` | The schema that contains the graph to which data is written. | No | `/default_schema` | String | 5.0 | `withDateFormat` | The date format to be set in the session. If not specified, the default date format in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.1 | `withZonedDatetimeFormat` | The zoned datetime format to be set in the session. If not specified, the default zoned datetime format in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.0 | `withLocalDatetimeFormat` | The local datetime format to be set in the session. If not specified, the default local datetime format in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.0 | `withZonedTimeFormat` | The zoned time format to be set in the session. If not specified, the default zoned time format in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.0 | `withLocalTimeFormat` | The local time format to be set in the session. If not specified, the default local time format in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.0 | `withNodeType` | The type of the node to which data is written. | Yes | N/A | String | 5.0 | `withWriteMode` | The write mode. Valid values: `INSERT`, `INSERTIGNORE`, `INSERTREPLACE`, `INSERTUPDATE`, `UPDATE`, `DELETE`, and `DETACHDELETE`. | No | `INSERT` | WriteMode | 5.0 | `withBatchSize` | The maximum number of nodes to be written in a batch. | No | 512 | Integer | 5.0 | `withDisableWriteLog` | Whether to disable logging during the write process. If set to `true`, logging is disabled for successful writes. | No | false | Boolean | 5.0 ## `WriteNebulaEdgeConfig` | Method | Description | Required | Default value | Data type | Introduced in | `withGraphName` | The name of the graph to which data is written. | Yes | N/A | String | 5.0 | `withSchema` | The schema that contains the graph to which data is written. | No | `/default_schema` | String | 5.0 | `withDateFormat` | The date format to be set in the session. If not specified, the date format set in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.1 | `withZonedDatetimeFormat` | The zoned datetime format to be set in the session. If not specified, the zoned datetime format set in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.0 | `withLocalDatetimeFormat` | The local datetime format to be set in the session. If not specified, the local datetime format set in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.0 | `withZonedTimeFormat` | The zoned time format to be set in the session. If not specified, the zoned time format set in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.0 | `withLocalTimeFormat` | The local time format to be set in the session. If not specified, the local time format set in NebulaGraph Database Developer Edition is used. | No | N/A | String | 5.0 | `withEdgeType` | The type of the edge to which data is written. | Yes | N/A | String | 5.0 | `withSrcPkField` | The column in the DataFrame that serves as the primary key of the source node type of the edge type. Use this method only if the primary key consists of one property. | No | N/A | String | 5.0 | `withSrcPkFields` | The one or more columns in the DataFrame that serve as the primary key of the source node type of the edge type. Use this method if `withSrcPkField` is not specified. | No | N/A | List | 5.0 | `withDstPkField` | The column in the DataFrame that serves as the primary key of the destination node type of the edge type. Use this method only if the primary key consists of one property. | No | N/A | String | 5.0 | `withDstPkFields` | The one or more columns in the DataFrame that serve as the primary key of the destination node type of the edge type. Use this method if `withDstPkField` is not specified. | No | N/A | List | 5.0 | `withSrcPkAsProperty` | Whether the one or more columns that serve as the primary key of the source node type of the edge type are written as one or more properties of the edge type. | No | false | Boolean | 5.0 | `withDstPkAsProperty` | Whether the one or more columns that serve as the primary key of the destination node type of the edge type are written as one or more properties of the edge type. | No | false | Boolean | 5.0 | `withWriteMode` | The write mode. Valid values: `INSERT`, `INSERTIGNORE`, `INSERTREPLACE`, `INSERTUPDATE`, `UPDATE`, `DELETE`, and `DETACHDELETE`. | No | `INSERT` | WriteMode | 5.0 | `withBatchSize` | The maximum number of edges to be written in a batch. | No | 512 | Integer | 5.0 | `withDisableWriteLog` | Whether to disable logging during the write process. If set to `true`, logging is disabled for successful writes. | No | false | Boolean | 5.0 ## `ReadNebulaConfig` | Method | Description | Required | Default value | Data type | Introduced in | `withGraphName` | The name of the graph from which data is read. | Yes | N/A | String | 5.0 | `withSchema` | The schema that contains the graph from which data is read. | No | `/default_schema` | String | 5.0 | `withTypeName` | The type of the node or edge from which data is read. | Yes | N/A | String | 5.0 | `withReturnCols` | The list of properties to read. If not specified or set to `null`, all properties of the node type or edge type are read. If set to an empty list for a node type, only properties that constitute the primary key of the node type are read. If set to an empty list for an edge type, only properties that constitute the primary keys of the source and destination node types of the edge type are read. | No | `null` | List | 5.0 | `withPartitionNum` | The number of Spark partitions to read data in parallel. It is recommended that you set it to a value no larger than the number of partitions set in the graph. | No | 10 | Integer | 5.0 | `withBatchSize` | The maximum number of data entries to read in each request. | No | 2000 | Integer | 5.0