mirror of
https://github.com/alibaba/DataX.git
synced 2025-05-02 07:21:48 +08:00
测试方法命名风格改为驼峰;
更新文档
This commit is contained in:
parent
cc90994e17
commit
7e302fcd1b
@ -47,6 +47,7 @@ LOCAL_DATE,
|
|||||||
LOCAL_TIME,
|
LOCAL_TIME,
|
||||||
LOCAL_DATE_TIME,
|
LOCAL_DATE_TIME,
|
||||||
LIST,
|
LIST,
|
||||||
|
//map类型支持 . 属性表达式取值
|
||||||
MAP,
|
MAP,
|
||||||
CHAR_ARRAY,
|
CHAR_ARRAY,
|
||||||
BYTE_ARRAY,
|
BYTE_ARRAY,
|
||||||
@ -169,9 +170,10 @@ Object_ARRAY
|
|||||||
|
|
||||||
## 注意事项
|
## 注意事项
|
||||||
|
|
||||||
* properties的定义的顺序需要与源端一一对应,但数量不必要对齐,neo4j writer 会取最小值。如果源端的数据列少于neo4j字段怎么办?建议将源端数据加工成json格式,在neo4j端将数据类型设置成map。在cypher中,可以根据jsonpath语法一直取值。比如 unwind $batch as row create (p) set p.name = row.properties.name,set p.age = row.properties.age
|
* properties定义的顺序需要与reader端顺序一一对应。
|
||||||
* 如果提示事务超时,建议调大事务运行时间或者调小batch_size
|
* 灵活使用map类型,可以免去很多数据加工的烦恼。在cypher中,可以根据 . 属性访问符号一直取值。比如 unwind $batch as row create (p) set p.name = row.prop.name,set p.age = row.prop.age,在这个例子中,prop是map类型,包含name和age两个属性。
|
||||||
* 如果用于更新场景,会遇到死锁问题,建议二开源码加入死锁异常检测,并进行重试,开源版本不提供此功能。
|
* 如果提示事务超时,建议调大事务运行时间或者调小batchSize
|
||||||
|
* 如果用于更新场景,遇到死锁问题影响写入,建议二开源码加入死锁异常检测,并进行重试。
|
||||||
|
|
||||||
## 性能报告
|
## 性能报告
|
||||||
|
|
||||||
@ -185,7 +187,7 @@ Object_ARRAY
|
|||||||
|
|
||||||
**datax 配置**
|
**datax 配置**
|
||||||
|
|
||||||
Channel 20 batchsize = 1000
|
* Channel 20 batchsize = 1000
|
||||||
任务平均流量:15.23MB/s
|
* 任务平均流量:15.23MB/s
|
||||||
记录写入速度:44440 rec/s
|
* 记录写入速度:44440 rec/s
|
||||||
读出记录总数:2222013
|
* 读出记录总数:2222013
|
||||||
|
@ -87,7 +87,7 @@ public class Neo4jWriterTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_create_node_all_type_field() {
|
public void testCreateNodeAllTypeField() {
|
||||||
final Result checkExists = neo4jSession.run("MATCH (p:Person) RETURN p limit 1");
|
final Result checkExists = neo4jSession.run("MATCH (p:Person) RETURN p limit 1");
|
||||||
if (checkExists.hasNext()) {
|
if (checkExists.hasNext()) {
|
||||||
neo4jSession.run("MATCH (p:Person) delete p");
|
neo4jSession.run("MATCH (p:Person) delete p");
|
||||||
@ -128,7 +128,7 @@ public class Neo4jWriterTest {
|
|||||||
* 所以先创建节点再模拟关系
|
* 所以先创建节点再模拟关系
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void test_create_relation() {
|
public void testCreateRelation() {
|
||||||
final Result checkExists = neo4jSession.run("MATCH (p1:Person)-[r:LINK]->(p1:Person) return r limit 1");
|
final Result checkExists = neo4jSession.run("MATCH (p1:Person)-[r:LINK]->(p1:Person) return r limit 1");
|
||||||
if (checkExists.hasNext()) {
|
if (checkExists.hasNext()) {
|
||||||
neo4jSession.run("MATCH (p1:Person)-[r:LINK]->(p1:Person) delete r,p1,p2");
|
neo4jSession.run("MATCH (p1:Person)-[r:LINK]->(p1:Person) delete r,p1,p2");
|
||||||
@ -179,7 +179,7 @@ public class Neo4jWriterTest {
|
|||||||
* neo4j中,Label和关系类型,想动态的写,需要借助于apoc函数
|
* neo4j中,Label和关系类型,想动态的写,需要借助于apoc函数
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void test_use_apoc_create_dynamic_label() {
|
public void testUseApocCreateDynamicLabel() {
|
||||||
List<String> dynamicLabel = new ArrayList<>();
|
List<String> dynamicLabel = new ArrayList<>();
|
||||||
for (int i = 0; i < MOCK_NUM; i++) {
|
for (int i = 0; i < MOCK_NUM; i++) {
|
||||||
dynamicLabel.add("Label" + i);
|
dynamicLabel.add("Label" + i);
|
||||||
|
Loading…
Reference in New Issue
Block a user