Re: Scala examples for Spark do not work as written in documentation

2014-06-20 Thread Patrick Wendell
gt; From: "Andy Konwinski" >> To: dev@spark.apache.org >> Sent: Tuesday, May 20, 2014 4:06:33 PM >> Subject: Re: Scala examples for Spark do not work as written in documentation >> >> I fixed the bug, but I kept the parameter "i" instead of "

Re: Scala examples for Spark do not work as written in documentation

2014-06-20 Thread Will Benton
val x = Math.random() > > >> ^ > > >> > > >> If I rewrite the query slightly, adding in {}, it works: > > >> > > >> val count = spark.parallelize(1 to 1).map(i => > > >>{ > > >>val x = Math.random() > > >>val y = Math.random() > > >>if (x*x + y*y < 1) 1 else 0 > > >>} > > >> ).reduce(_ + _) > > >> println("Pi is roughly " + 4.0 * count / 1.0) > > >> > > >> > > >> > > >> > > >> > > >> -- > > >> View this message in context: > > >> > > http://apache-spark-developers-list.1001551.n3.nabble.com/Scala-examples-for-Spark-do-not-work-as-written-in-documentation-tp6593.html > > >> Sent from the Apache Spark Developers List mailing list archive at > > >> Nabble.com. > > >> > > > > > > > > >

Re: Scala examples for Spark do not work as written in documentation

2014-05-20 Thread Andy Konwinski
^ > >> > >> If I rewrite the query slightly, adding in {}, it works: > >> > >> val count = spark.parallelize(1 to 10000).map(i => > >> { > >>val x = Math.random() > >>val y = Math.random() > >>if (x*x + y*y

Re: Scala examples for Spark do not work as written in documentation

2014-05-16 Thread GlennStrycker
not-be-arbitrary-function-td6606.html -- View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/Scala-examples-for-Spark-do-not-work-as-written-in-documentation-tp6593p6607.html Sent from the Apache Spark Developers List mailing list archive at Nabble.com.

Re: Scala examples for Spark do not work as written in documentation

2014-05-16 Thread Mark Hamstra
>> ).reduce(_ + _) >> println("Pi is roughly " + 4.0 * count / 1.0) >> >> >> >> >> >> -- >> View this message in context: >> http://apache-spark-developers-list.1001551.n3.nabble.com/Scala-examples-for-Spark-do-not-work-as-written-in-documentation-tp6593.html >> Sent from the Apache Spark Developers List mailing list archive at >> Nabble.com. >> > >

Re: Scala examples for Spark do not work as written in documentation

2014-05-16 Thread Mark Hamstra
unt = spark.parallelize(1 to 1).map(i => >{ >val x = Math.random() >val y = Math.random() >if (x*x + y*y < 1) 1 else 0 >} > ).reduce(_ + _) > println("Pi is roughly " + 4.0 * count / 10000.0) > > > > > > -- > View t

Re: Scala examples for Spark do not work as written in documentation

2014-05-16 Thread Reynold Xin
count / 1.0) > > > > > > -- > View this message in context: > http://apache-spark-developers-list.1001551.n3.nabble.com/Scala-examples-for-Spark-do-not-work-as-written-in-documentation-tp6593.html > Sent from the Apache Spark Developers List mailing list archive at > Nabble.com. >

Scala examples for Spark do not work as written in documentation

2014-05-16 Thread GlennStrycker
h.random() val y = Math.random() if (x*x + y*y < 1) 1 else 0 } ).reduce(_ + _) println("Pi is roughly " + 4.0 * count / 1.0) -- View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/Scala-examples-for-Spark-do-not-work-as-written-in-documentation-