How can we implement multiple core division with pyspark in local machine?

Viewed 44

My PC is an 18 core machine. I want to make use of all the cores at a time in order to avail the parallelism in pyspark.

spark = (SparkSession
  .builder
  .master("local[18]")
  .appName("sparkexample")
  .getOrCreate())

I used the above query. Are all cores working together or I have to set any configuration file for the same?

1 Answers

local[*] will use all the available cores.

  spark = (SparkSession
      .builder
      .master("local[*]")
      .appName("sparkexample")
      .getOrCreate())
Related