【发布时间】:2018-06-27 05:59:30
【问题描述】:
以下
GraphTraversal<Row, Edge> traversal = gf().E().hasLabel("foo").limit(5);
while (traversal.hasNext()) {}
导致以下异常:
java.lang.UnsupportedOperationException: Row to Vertex conversion is not supported: Use .df().collect() instead of the iterator
at com.datastax.bdp.graph.spark.graphframe.DseGraphTraversal.iterator$lzycompute(DseGraphTraversal.scala:92)
at com.datastax.bdp.graph.spark.graphframe.DseGraphTraversal.iterator(DseGraphTraversal.scala:78)
at com.datastax.bdp.graph.spark.graphframe.DseGraphTraversal.hasNext(DseGraphTraversal.scala:129)
Exception 说要使用.df().collect(),但gf().E().hasLabel("foo") 不允许你事后使用.df()。换句话说,方法df() 不存在hasLabel() 返回的对象
我通过dse-graph-frames:5.1.4 和dse-byos_2.11:5.1.4 使用Java API。
【问题讨论】:
标签: datastax datastax-enterprise datastax-java-driver datastax-enterprise-graph