OrientDB仅使用ETL工具导入边

时间:2016-05-10 08:45:39

标签: etl orientdb orientdb-2.1 orientdb-etl

我已经使用OETL将我的所有顶点插入到图表中。

现在我有一个文件以下列方式概述边缘:

  

node_1,rel_type,node_2
  11000001,relation_A,10208879个
  11000001,relation_A,10198662个
  11000001,relation_B,10159927个
  11000001,relation_C,10165779

如何使用OrientDB OETL工具导入它?

我尝试了以下内容:

"transformers": [
    { "csv": {} },
    { "command" : {
            "command" : "create edge ${rel_type} from (select flatten(@rid) from V where node_id= ${node_1}) to (select flatten(@rid) from V where node_id = ${node_2})",
            "output" : "edge"
        }
    }
  ],

但由于无法解析csv中的值,因此无效。

1 个答案:

答案 0 :(得分:1)

您必须使用$ input变量。

"transformers": [{
        "csv": {
            "separator": ","
        }
    },
    {
    "command" : {
            "command" : "create edge ${input.rel_type} from (select from V where node_id= ${input.node_1}) to (select from V where node_id = ${input.node_2})",
            "output" : "edge"
        }
    }
  ],

它对我有用。

enter image description here

希望它有所帮助。

相关问题