1

I'm using GraphFrame in Spark GraphX. I tried to find the a diamond in my graph. My graph as following:

nodeA->nodeB->nodeD->nodeF
nodeA->nodeE->nodeD->nodeG

so we can know there is a diamond(quadrilateral) in the graph as nodeA->nodeB(nodeE)->nodeD. Then I used the the following query syntax:

val motifs= graphFrame.find("(A)-[e1]->(B);(A)-[e2]->(C);(B)-[e3]->(D);(C)-[e4]->(D)").filter("A.id!=D.id")
val e2 = motifs.select("A","B","C","D")
e2.collect().foreach(println(_))

but the result was wrong, did I make mistake in the above query clause please?

Jack
  • 5,540
  • 13
  • 65
  • 113

0 Answers0