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 /site | |
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 'site')
-rw-r--r-- | site/examples.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/site/examples.html b/site/examples.html index 47962db4f..ff3f35578 100644 --- a/site/examples.html +++ b/site/examples.html @@ -317,11 +317,11 @@ previous ones, and <em>actions</em>, which kick off a job to execute on a cluste </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> |