OKdevTV Docs
Home OKdevTV
ESC
spark 1 min read 0.4 KB Raw Markdown
On this page (1)

Spark

Getting Started

  • bin/pyspark
py
textFile = sc.textFile("README.md")
textFile.count()

textFile.first()

linesWithSpark = textFile.filter(lambda line: "Spark" in line)
linesWithSpark.collect()

textFile.map(lambda line: len(line.split())).reduce(lambda a, b: a if (a > b) else b)