On Wed, Apr 2, 2014 at 7:11 PM, yh18190 <yh18...@gmail.com> wrote: > Is it always needed that sparkcontext object be created in Main method of > class.Is it necessary?Can we create "sc" object in other class and try to > use it by passing this object through function and use it? >
The Spark context can be initialized wherever you like and passed around just as any other object. Just don't try to create multiple contexts against "local" (without stopping the previous one first), or you may get ArrayStoreExceptions (I learned that one the hard way). -- Daniel Siegmann, Software Developer Velos Accelerating Machine Learning 440 NINTH AVENUE, 11TH FLOOR, NEW YORK, NY 10001 E: daniel.siegm...@velos.io W: www.velos.io