spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörn Franke <jornfra...@gmail.com>
Subject Re: [Spark 2.x Core] Adding to ArrayList inside rdd.foreach()
Date Sat, 07 Apr 2018 17:12:38 GMT
What are you trying to achieve ? You should not use global variables in a spark application.
Especially not adding to a list - that makes in most cases no sense.

If you want to put everything into a file then you should repartition to 1 .


> On 7. Apr 2018, at 19:07, klrmowse <klrmowse@gmail.com> wrote:
> 
> it gives null pointer exception...
> 
> is there a workaround for adding to an arrayList during .foreach of an rdd?
> 
> 
> thank you
> 
> 
> 
> 
> --
> Sent from: http://apache-spark-user-list.1001560.n3.nabble.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe e-mail: user-unsubscribe@spark.apache.org
> 

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org


Mime
View raw message