Neo4j
Neo4j 写连接器
描述
写数据到 Neo4j
。
neo4j-java-driver
version 4.4.9
主要功能
配置选项
名称 | 类型 | 是否必须 | 默认值 |
---|---|---|---|
uri | String | 是 | - |
username | String | 否 | - |
password | String | 否 | - |
max_batch_size | Integer | 否 | - |
write_mode | String | 否 | OneByOne |
bearer_token | String | 否 | - |
kerberos_ticket | String | 否 | - |
database | String | 是 | - |
query | String | 是 | - |
queryParamPosition | Object | 是 | - |
max_transaction_retry_time | Long | 否 | 30 |
max_connection_timeout | Long | 否 | 30 |
common-options | config | 否 | - |
uri [string]
Neo4j
数据库的URI,参考配置: neo4j://localhost:7687
。
username [string]
Neo4j
用户名。
password [string]
Neo4j
密码。如果提供了“用户名”,则需要。
max_batch_size[Integer]
max_batch_size
是指写入数据时,单个事务中可以写入的最大数据条目数。
write_mode
默认值为 oneByOne
,如果您想批量写入,请将其设置为Batch
unwind $ttt as row create (n:Label) set n.name = row.name,n.age = rw.age
ttt
代表一批数据。,ttt
可以是任意字符串,只要它与配置的batch_data_variable
匹配。
bearer_token [string]
Neo4j
的base64
编码bearer token
用于鉴权。
kerberos_ticket [string]
Neo4j
的base64
编码kerberos ticket
用于鉴权。
database [string]
数据库名称。
query [string]
查询语句。包含在运行时用相应值替换的参数占位符。
queryParamPosition [object]
查询参数的位置映射信息。
键名是参数占位符名称。
关联值是字段在输入数据行中的位置。
max_transaction_retry_time [long]
最大事务重试时间(秒)。如果超过,则交易失败。
max_connection_timeout [long]
等待TCP连接建立的最长时间(秒)。
common options
Sink插件常用参数, 详细信息请参考 Sink公共配置
OneByOne模式写示例
sink {
Neo4j {
uri = "neo4j://localhost:7687"
username = "neo4j"
password = "1234"
database = "neo4j"
max_transaction_retry_time = 10
max_connection_timeout = 10
query = "CREATE (a:Person {name: $name, age: $age})"
queryParamPosition = {
name = 0
age = 1
}
}
}
Batch模式写示例
cypher提供的
unwind
关键字支持批量写入, 批量数据的默认变量是batch。如果你写一个批处理写语句, 那么你应该声明 cypherunwind $batch
作为行sink {
Neo4j {
uri = "bolt://localhost:7687"
username = "neo4j"
password = "neo4j"
database = "neo4j"
max_batch_size = 1000
write_mode = "BATCH"
max_transaction_retry_time = 3
max_connection_timeout = 10
query = "unwind $batch as row create(n:MyLabel) set n.name = row.name,n.age = row.age"
}
}
变更日志
Change Log
Change | Commit | Version |
---|---|---|
[Improve] restruct connector common options (#8634) | https://github.com/apache/seatunnel/commit/f3499a6ee | 2.3.10 |
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786) | https://github.com/apache/seatunnel/commit/6b7c53d03 | 2.3.9 |
[Feature][Doris] Add Doris type converter (#6354) | https://github.com/apache/seatunnel/commit/518999184 | 2.3.6 |
[Feature][Core] Upgrade flink source translation (#5100) | https://github.com/apache/seatunnel/commit/5aabb14a9 | 2.3.4 |
[Improve][Common] Introduce new error define rule (#5793) | https://github.com/apache/seatunnel/commit/9d1b2582b | 2.3.4 |
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755) | https://github.com/apache/seatunnel/commit/8de740810 | 2.3.4 |
Support config column/primaryKey/constraintKey in schema (#5564) | https://github.com/apache/seatunnel/commit/eac76b4e5 | 2.3.4 |
[Improve] Documentation and partial word optimization. (#4936) | https://github.com/apache/seatunnel/commit/6e8de0e2a | 2.3.3 |
[Improve][connector-V2-Neo4j]Supports neo4j sink batch write and update docs (#4841) | https://github.com/apache/seatunnel/commit/580276a8b | 2.3.3 |
Merge branch 'dev' into merge/cdc | https://github.com/apache/seatunnel/commit/4324ee191 | 2.3.1 |
[Improve][Project] Code format with spotless plugin. | https://github.com/apache/seatunnel/commit/423b58303 | 2.3.1 |
[improve][api] Refactoring schema parse (#4157) | https://github.com/apache/seatunnel/commit/b2f573a13 | 2.3.1 |
[Improve][build] Give the maven module a human readable name (#4114) | https://github.com/apache/seatunnel/commit/d7cd60105 | 2.3.1 |
[Improve][Project] Code format with spotless plugin. (#4101) | https://github.com/apache/seatunnel/commit/a2ab16656 | 2.3.1 |
[Feature][Connector] add get source method to all source connector (#3846) | https://github.com/apache/seatunnel/commit/417178fb8 | 2.3.1 |
[Feature][API & Connector & Doc] add parallelism and column projection interface (#3829) | https://github.com/apache/seatunnel/commit/b9164b8ba | 2.3.1 |
[Hotfix][OptionRule] Fix option rule about all connectors (#3592) | https://github.com/apache/seatunnel/commit/226dc6a11 | 2.3.0 |
[Improve][Connector-V2][Neo4j] Unified exception for Neo4j source & sink connector (#3565) | https://github.com/apache/seatunnel/commit/58584eefb | 2.3.0 |
[Feature][Connector][Neo4j] expose configurable options in Neo4j (#3342) | https://github.com/apache/seatunnel/commit/efa04b38f | 2.3.0 |
[Connector-V2][ElasticSearch] Add ElasticSearch Source/Sink Factory (#3325) | https://github.com/apache/seatunnel/commit/38254e3f2 | 2.3.0 |
[Feature][Connector-v2] Neo4j source connector (#2777) | https://github.com/apache/seatunnel/commit/38b0daf8b | 2.3.0 |
[#2606]Dependency management split (#2630) | https://github.com/apache/seatunnel/commit/fc047be69 | 2.2.0-beta |
[Feature][Connector-v2] Neo4j sink connector (#2434) | https://github.com/apache/seatunnel/commit/950b27d13 | 2.2.0-beta |