Skip to content

Instantly share code, notes, and snippets.

@josep2
Created April 2, 2017 23:01
Show Gist options
  • Save josep2/de4814f8a3d7d84cc5512f2f215ff0d1 to your computer and use it in GitHub Desktop.
Save josep2/de4814f8a3d7d84cc5512f2f215ff0d1 to your computer and use it in GitHub Desktop.
val result = g.stronglyConnectedComponents.maxIter(5).run()
result.show()
+---+-------+---+--------+----------+---------+
| id| name|age| cash| fruit|component|
+---+-------+---+--------+----------+---------+
| a| Alice| 34| 234| Apples| 0|
| g| Gabby| 60| 23433| Oranges| 6|
| f| Fanny| 36| 333| Apples| 5|
| b| Bob| 36|23232323| Bananas| 1|
| d| David| 29| 2321111| Bananas| 0|
| c|Charlie| 30| 2123|Grapefruit| 1|
| e| Esther| 32| 1|Watermelon| 0|
+---+-------+---+--------+----------+---------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment