Reputation: 21625
I want to know at runtime whether the program is being run in local mode (just one node) or a cluster (for example yarn-client or yarn-cluster)?
Upvotes: 1
Views: 1764
Reputation: 31
You can directly call
spark.sparkContext.isLocal
Upvotes: 3
Reputation: 46
Just use master property:
master
spark.sparkContext.master: String