Talend Neo4j Relationship component throws error when start node doesn't exist

流过昼夜 提交于 2019-12-13 03:21:29

问题


We're using Talend Open Studio for Big Data to migrate MySQL data to Neo4j. I've gotten a few jobs to run, however I get stuck using the tNeo4jOutputRelationship compontent on a rels.csv file which contains relatioships between values that dont exist in our nodes.csv file.

Explicit error that is thrown:

Exception in component tNeo4jOutputRelationship_1

    java.lang.RuntimeException: Start node looked up by index with my_index as key and my_value as value doesn't exist

Did a bit of research and found the portion of code throwing the error on Github

Is it possible to suppress this error temporarily at runtime? We do have quite a bit of restructured data and not every rels.csv is going to match the nodes.csv for each job.


回答1:


The easiest way that I see it is to create the nodes.csv file with ID you either have in MySQL or generate ids for the nodes when exporting from MySQL to nodes.csv.

Then, when creating the nodes using tNeo4jOutput, you also create an index for the ID you get from the MySQL data.

The next step is then to create a representation for the relationships in MySQL and export to CSV. This will have start and end IDs for the nodes that should be connected.

Then when using the tNeo4jOutputRelationship component you specify what index to use for looking up the IDs and specify the start and end IDs from the relationship.csv file.



来源:https://stackoverflow.com/questions/19327968/talend-neo4j-relationship-component-throws-error-when-start-node-doesnt-exist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!