[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
spark:spark-introduction [2014/11/11 09:13]
straka
spark:spark-introduction [2022/12/14 12:27]
straka [Spark Introduction]
Line 1: Line 1:
 ====== Spark Introduction ====== ====== Spark Introduction ======
  
-This introduction shows several simple examples to give you an idea what programming in Spark is like. See the official [[http://spark.apache.org/docs/latest/quick-start.html|Quick Start]] or [[http://spark.apache.org/docs/latest/programming-guide.html|Spark Programming Guide]] or [[http://spark.apache.org/docs/latest/api/python/index.html|Python API Reference]]/[[http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.package|Scala API Reference]] for more information.+This introduction shows several simple examples to give you an idea what programming in Spark is like. See the official [[http://spark.apache.org/docs/latest/quick-start.html|Quick Start]] or [[http://spark.apache.org/docs/latest/programming-guide.html|Spark Programming Guide]] or [[http://spark.apache.org/docs/latest/api/python/index.html|Python API Reference]]/[[https://spark.apache.org/docs/latest/api/scala/org/apache/spark/index.html|Scala API Reference]] for more information.
  
 ===== Running Spark Shell in Python ===== ===== Running Spark Shell in Python =====
Line 51: Line 51:
 val counts = words.map(word => (word,1)).reduceByKey((c1,c2) => c1+c2) val counts = words.map(word => (word,1)).reduceByKey((c1,c2) => c1+c2)
 val sorted = counts.sortBy({case (word, count) => count}, ascending=false) val sorted = counts.sortBy({case (word, count) => count}, ascending=false)
-sorted.saveAsTextFile('output')+sorted.saveAsTextFile("output")
  
 // Alternatively without variables and using placeholders in lambda parameters: // Alternatively without variables and using placeholders in lambda parameters:

[ Back to the navigation ] [ Back to the content ]