Skip to content

Instantly share code, notes, and snippets.

@vzayaz
Created September 6, 2020 20:56
Show Gist options
  • Save vzayaz/1609bc150d47a9b67e0d28ba77981539 to your computer and use it in GitHub Desktop.
Save vzayaz/1609bc150d47a9b67e0d28ba77981539 to your computer and use it in GitHub Desktop.
def pseudo_rdd_count(rdd: RDD[T]): Long = {
val iter = rdd.compute
var result = 0
while (iter.hasNext) result += 1
result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment