DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #114
The code block shown below should adjust the number of partitions used in wide transformations like join() to 32. Choose the response that correctly fills in the numbered blanks within the code…
The correct answer is E. 1. spark.conf.set. To configure the number of shuffle partitions in Spark (used in wide transformations like join() and groupBy()), you use spark.conf.set(). The complete code is spark.conf.set('spark.sql.shuffle.partitions', 32). The method spark.conf.set writes a configuration value, whereas…
Question
The code block shown below should adjust the number of partitions used in wide transformations like join() to 32. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block:
1(2, 3)
Options
- A
- spark.conf.get
- B
- spark.conf.set
- C
- spark.conf.text
- D
- spark.conf.set
- E
- spark.conf.set
How the community answered
(23 responses)- A9% (2)
- B4% (1)
- E87% (20)
Explanation
To configure the number of shuffle partitions in Spark (used in wide transformations like join() and groupBy()), you use spark.conf.set(). The complete code is spark.conf.set('spark.sql.shuffle.partitions', 32). The method spark.conf.set writes a configuration value, whereas spark.conf.get only reads one. spark.conf.text does not exist. Choice E provides the correct method (spark.conf.set) along with the correct config key ('spark.sql.shuffle.partitions') and value (32). The default value of spark.sql.shuffle.partitions is 200, so this setting overrides it to 32.
Topics
Community Discussion
No community discussion yet for this question.