Don't have to do toArray - think in M/R terms.

HashTable a;
rdd.map(s => a[s.key]=s.value).

Broadcast variables are treated like regular variables (as far as syntax is 
concerned) . The difference is that normally Spark has to serialize and send to 
all nodes any variables in the scope of your function every time they are used. 
Broadcast variables are not shipped back and forth - making them more efficient.

-----Original Message-----
From: kpeng1 [kpe...@gmail.com<mailto:kpe...@gmail.com>]
Sent: Tuesday, October 28, 2014 07:05 PM Eastern Standard Time
To: u...@spark.incubator.apache.org
Subject: RE: Is it possible to call a transform + action inside an action?


Ok cool.  So in that case the only way I could think of doing this would be
calling the toArray method on those RDDs which would return Array[String]
and store them as broadcast variables.  I read about the broadcast
variables, but it still fuzzy.  I am assume that since broadcast variables
are available to all nodes in the cluster... programmatically I can treat
them as globals and use them in different object from the ones that they are
defined in?



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Is-it-possible-to-call-a-transform-action-inside-an-action-tp17568p17572.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

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

________________________________________________________

The information contained in this e-mail is confidential and/or proprietary to 
Capital One and/or its affiliates. The information transmitted herewith is 
intended only for use by the individual or entity to which it is addressed.  If 
the reader of this message is not the intended recipient, you are hereby 
notified that any review, retransmission, dissemination, distribution, copying 
or other use of, or taking of any action in reliance upon this information is 
strictly prohibited. If you have received this communication in error, please 
contact the sender and delete the material from your computer.

Reply via email to