下列
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)
例外说,使用.df().collect()
但gf().E().hasLabel("foo")
不允许你这样做.df()
之后。 换句话说,方法df()
是不存在用于通过返回对象hasLabel()
我使用通过Java API dse-graph-frames:5.1.4
随着dse-byos_2.11:5.1.4
。