diff options
author | Andy Konwinski <andrew@apache.org> | 2014-05-20 21:02:48 +0000 |
---|---|---|
committer | Andy Konwinski <andrew@apache.org> | 2014-05-20 21:02:48 +0000 |
commit | 3f1f6630525f75e17d87441470e71e8cd9e0c5d6 (patch) | |
tree | 82cdc3891babf917a8fe11eee5a73efc147dd23a /examples.md | |
parent | 82fbf10ee5e7c8f611024bc4184467fd355a849a (diff) | |
download | spark-website-3f1f6630525f75e17d87441470e71e8cd9e0c5d6.tar.gz spark-website-3f1f6630525f75e17d87441470e71e8cd9e0c5d6.tar.bz2 spark-website-3f1f6630525f75e17d87441470e71e8cd9e0c5d6.zip |
fix bug in pi example replacing ()'s with {}'s
Diffstat (limited to 'examples.md')
-rw-r--r-- | examples.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples.md b/examples.md index ec381c124..92253c184 100644 --- a/examples.md +++ b/examples.md @@ -167,11 +167,11 @@ In this example, we search through the error messages in a log file: </div> <div class="tab-pane tab-pane-scala"> <div class="code code-tab"> - <span class="keyword">val</span> count = spark.parallelize(1 to NUM_SAMPLES).<span class="sparkop">map</span>(<span class="closure">i =><br> + <span class="keyword">val</span> count = spark.parallelize(1 to NUM_SAMPLES).<span class="sparkop">map</span>{<span class="closure">i =><br> val x = Math.random()<br> val y = Math.random()<br> if (x*x + y*y < 1) 1 else 0<br> - </span>).<span class="sparkop">reduce</span>(<span class="closure">_ + _</span>)<br> + </span>}.<span class="sparkop">reduce</span>(<span class="closure">_ + _</span>)<br> println(<span class="string">"Pi is roughly "</span> + 4.0 * count / NUM_SAMPLES)<br> </div> </div> |