【问题标题】:Orientdb ETL update Vertex or just add edgeOrientdb ETL 更新顶点或仅添加边缘
【发布时间】:2015-10-10 21:43:15
【问题描述】:

我有 3 个 CSV 文件要加载到 OrientDB 图表中。

  • 产品
  • 购买

People.csv 就像

person_id;name
1;francesco
2;luca

Product.csv 就像

product_id;product_name
101;apple
102;banana

Purchases.csv 就像

person_id;product_id;avg_price
1;101;$1.10
2;101;$1.08
1;102;$5.34

我首先使用 2 个不同的 ETL 作业加载所有人员和产品。 每个作业都加载顶点。

当人们购买新产品时,如何使用 OrientdbETL 定期加载边缘?

所有Transformers,尤其是EDGE 输出OrientVertex,只能通过LOADER 步骤插入。 (EDGE Transformer 将 EDGE 属性添加到 Vertex,但实际操作是 Vertex 的 INSERT)。有没有办法使用 ETL 更新顶点?

Rgds,

弗朗西斯科

【问题讨论】:

    标签: orientdb


    【解决方案1】:

    带有这些转换器的 ETL json 应该从 purchase.csv 导入“购买”边并更新每个购买产品的 avg_price。

    "transformers": [
    { "merge": { "joinFieldName": "product_id", "lookup": "Product.id" } },
    { "vertex": {"class": "Product", "skipDuplicates": true} }, 
    { "edge": { "class": "Purchase",
                "joinFieldName": "person_id",
                "lookup": "Person.id",
                "direction": "in"
            }
        },
    { "field": { "fieldNames": ["person_id", "product_id"], "operation": "remove" } }
    ]
    

    类和属性名称(“Product.id”、“Person”等)可能因您的数据库架构而异。

    【讨论】:

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