When you reference any variable outside the executor's scope, spark will
automatically serialize them in the driver, and send them to executors,
which implies, those variables have to implement serializable.
For the example you mention, the Spark will serialize object F, and if it's
not serializab
I see - I didn't realize that scope would work like that. Are you
saying that any variable that is in scope of the lambda passed to map
will be automagically propagated to all workers? What if it's not
explicitly referenced in the map, only used by it. E.g.:
def main:
settings.setSettings
rd
Since the evn variables in driver will not be passed into workers, the most
easy way you can do is refer to the variables directly in workers from
driver.
For example,
val variableYouWantToUse = System.getenv("something defined in env")
rdd.map(
you can access `variableYouWantToUse` here
)
Si
What is a good way to pass config variables to workers?
I've tried setting them in environment variables via spark-env.sh, but, as
far as I can tell, the environment variables set there don't appear in
workers' environments. If I want to be able to configure all workers,
what's a good way to do i