You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, we combined the [`flatMap`](programming-guide.html#transformations), [`map`](programming-guide.html#transformations) and [`reduceByKey`](programming-guide.html#transformations) transformations to compute the per-word counts in the file as an RDD of (String, Int) pairs. To collect the word counts in our shell, we can use the [`collect`](programming-guide.html#actions) action:
129
+
Here, we combined the [`flatMap`](programming-guide.html#transformations), [`map`](programming-guide.html#transformations), and [`reduceByKey`](programming-guide.html#transformations) transformations to compute the per-word counts in the file as an RDD of (String, Int) pairs. To collect the word counts in our shell, we can use the [`collect`](programming-guide.html#actions) action:
130
130
131
131
{% highlight scala %}
132
132
scala> wordCounts.collect()
@@ -163,7 +163,7 @@ One common data flow pattern is MapReduce, as popularized by Hadoop. Spark can i
Here, we combined the [`flatMap`](programming-guide.html#transformations), [`map`](programming-guide.html#transformations) and [`reduceByKey`](programming-guide.html#transformations) transformations to compute the per-word counts in the file as an RDD of (string, int) pairs. To collect the word counts in our shell, we can use the [`collect`](programming-guide.html#actions) action:
166
+
Here, we combined the [`flatMap`](programming-guide.html#transformations), [`map`](programming-guide.html#transformations), and [`reduceByKey`](programming-guide.html#transformations) transformations to compute the per-word counts in the file as an RDD of (string, int) pairs. To collect the word counts in our shell, we can use the [`collect`](programming-guide.html#actions) action:
167
167
168
168
{% highlight python %}
169
169
>>> wordCounts.collect()
@@ -217,13 +217,13 @@ a cluster, as described in the [programming guide](programming-guide.html#initia
217
217
</div>
218
218
219
219
# Self-Contained Applications
220
-
Now say we wanted to write a self-contained application using the Spark API. We will walk through a
221
-
simple application in both Scala (with SBT), Java (with Maven), and Python.
220
+
Suppose we wish to write a self-contained application using the Spark API. We will walk through a
221
+
simple application in Scala (with sbt), Java (with Maven), and Python.
222
222
223
223
<divclass="codetabs">
224
224
<divdata-lang="scala"markdown="1">
225
225
226
-
We'll create a very simple Spark application in Scala. So simple, in fact, that it's
226
+
We'll create a very simple Spark application in Scala--so simple, in fact, that it's
227
227
named `SimpleApp.scala`:
228
228
229
229
{% highlight scala %}
@@ -259,7 +259,7 @@ object which contains information about our
259
259
application.
260
260
261
261
Our application depends on the Spark API, so we'll also include an sbt configuration file,
262
-
`simple.sbt` which explains that Spark is a dependency. This file also adds a repository that
262
+
`simple.sbt`, which explains that Spark is a dependency. This file also adds a repository that
263
263
Spark depends on:
264
264
265
265
{% highlight scala %}
@@ -302,7 +302,7 @@ Lines with a: 46, Lines with b: 23
302
302
303
303
</div>
304
304
<divdata-lang="java"markdown="1">
305
-
This example will use Maven to compile an application jar, but any similar build system will work.
305
+
This example will use Maven to compile an application JAR, but any similar build system will work.
306
306
307
307
We'll create a very simple Spark application, `SimpleApp.java`:
308
308
@@ -374,7 +374,7 @@ $ find .
374
374
Now, we can package the application using Maven and execute it with `./bin/spark-submit`.
375
375
376
376
{% highlight bash %}
377
-
# Package a jar containing your application
377
+
# Package a JAR containing your application
378
378
$ mvn package
379
379
...
380
380
[INFO] Building jar: {..}/{..}/target/simple-project-1.0.jar
0 commit comments