vida
Databricks Employee
Databricks Employee

Hi,

You can use the Singleton Patter to create an object once per machine. This is explained very well on wikipedia:

https://en.wikipedia.org/wiki/Singleton_pattern

If you want to return values, you can use the mapPartitions transformation instead of the forEachPartition action.