NPE while reading broadcast variable.

184 views
Skip to first unread message

Archit Thakur

unread,
Dec 23, 2013, 12:57:26 AM12/23/13
to us...@spark.incubator.apache.org, spark...@googlegroups.com
Hi,

I am getting NPE while I access broadcast variable.

I created an object:

object ClusterVariableEnumeration {
 
  var CURRENT_EXECUTION: org.apache.spark.broadcast.Broadcast[Any] = null.asInstanceOf[org.apache.spark.broadcast.Broadcast[Any]];
}

and then after creating SparkContext, I did ClusterVariableEnumeration.CURRENT_EXECUTION = sc.broadcast("value")

and then in map function When I tried to access it it gave me NPE. Idea?

Thanks and Regards,
Archit Thakur.

Archit Thakur

unread,
Dec 23, 2013, 1:02:41 AM12/23/13
to us...@spark.incubator.apache.org, spark...@googlegroups.com
Accessed it:

val CURRENT_EXECUTING = ClusterVariableEnumeration.CURRENT_EXECUTION.value.asInstanceOf[String]

Archit Thakur

unread,
Dec 30, 2013, 2:31:19 PM12/30/13
to us...@spark.incubator.apache.org, spark...@googlegroups.com
I am still getting it. I googled and found a similar open problem on stackoverflow: http://stackoverflow.com/questions/17794664/accumulator-fails-on-cluster-works-locally.

Thx, Archit_Thakur.
Reply all
Reply to author
Forward
0 new messages