Talend Neo4j当开始节点不存在时,关系组件引发错误 [英] Talend Neo4j Relationship component throws error when start node doesn't exist

查看:384
本文介绍了Talend Neo4j当开始节点不存在时,关系组件引发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Talend Open Studio来处理大数据,将MySQL数据迁移到Neo4j。我有一些工作要运行,但是我被困在使用tNeo4jOutputRelationship组件的rels.csv文件,其中包含的值之间的不存在我们的nodes.csv文件中的相对。

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.

抛出的显式错误:

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

进行了一些研究,发现代码在 Github 上抛出错误的部分

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

是否可以在运行时暂时禁止此错误?我们有相当多的重组数据,而不是每个rels.csv将匹配nodes.csv为每个工作。

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.

推荐答案

我看到的最简单的方法是创建具有ID的nodes.csv文件,您可以在MySQL中或从MySQL导出到nodes.csv时为节点生成ids。

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.

然后,当使用tNeo4jOutput创建节点时,您还将为从MySQL数据获取的ID创建索引。

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

下一步是为MySQL中的关系创建一个表示并导出到CSV。这将有应该连接的节点的开始和结束ID。

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.

然后,当使用tNeo4jOutputRelationship组件时,您可以指定用于查找ID的索引,并从relationship.csv文件中指定开始和结束ID。

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.

这篇关于Talend Neo4j当开始节点不存在时,关系组件引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆