【问题标题】:Adding edge properties using DseGraphFrame API使用 DseGraphFrame API 添加边缘属性
【发布时间】:2021-01-10 00:49:16
【问题描述】:

如果我想添加带有属性的边作为数据框,属性数据应该采用什么格式?我正在阅读这些docs,但它没有解决任何有关属性列格式的问题。

例如:

Dataset<Row> edgesToAdd = sparkDataSetContainingData
            .select(
                dseGraphFrame.idColumn(lit(srcLabel), col("sourceName")).as("src"),
                dseGraphFrame.idColumn(lit(destLabel), col("destinationName")).as("dst"),
                lit(inputEdgeLabel).as("~label"),
                dseGraphFrame.idColumn("some_property_key", col("some_property_value")) // is this correct?
            );

    dseGraphFrame.updateEdges(edgesToAdd, true);

【问题讨论】:

    标签: datastax-enterprise


    【解决方案1】:

    这应该是正确的 - 您必须有 3 列:srcdst~label。前两个是使用idColumn 函数生成的,该函数接受顶点标签和顶点 ID 作为参数。您可以在DataStax-Examplesfollowing example 中看到这一点。

    还有很多关于该主题的资源:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-03
      • 1970-01-01
      • 2011-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多