println occurs on the machine where the task executes, which may or
may not be the same as your local driver process. collect()-ing brings
data back to the driver, so printing there definitely occurs on the
driver.

On Tue, Feb 24, 2015 at 9:48 AM, patcharee <patcharee.thong...@uni.no> wrote:
> Hi,
>
> I would like to print the content of RDD[String]. I tried
>
> 1) linesWithSpark.foreach(println)
> 2) linesWithSpark.collect().foreach(println)
>
> I submitted the job by spark-submit. 1) did not print, but 2) did.
>
> But when I used the shell, both 1) and 2) printed.
>
> Any ideas why 1) behaves differently on job submit and shell?
>
> Best,
> Patcharee
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
> For additional commands, e-mail: user-h...@spark.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to