【问题标题】:OrientDB import edges only using ETL toolOrientDB 仅使用 ETL 工具导入边
【发布时间】:2016-05-10 08:45:39
【问题描述】:

我已经使用 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 中的值。

【问题讨论】:

  • 你是如何导入所有顶点的?使用 orientdb 文档中的普通导入工具?因为我现在面临同样的问题

标签: etl orientdb orientdb-2.1 orientdb-etl


【解决方案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"
        }
    }
  ],

它对我有用。

希望对你有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-23
    相关资源
    最近更新 更多