Complete the code to enable adaptive query execution in Spark.
spark.conf.set("spark.sql.adaptive.enabled", [1])
Setting spark.sql.adaptive.enabled to "true" turns on adaptive query execution in Spark.
Complete the code to enable adaptive shuffle partition coalescing.
spark.conf.set("spark.sql.adaptive.coalescePartitions.enabled", [1])
Setting spark.sql.adaptive.coalescePartitions.enabled to "true" enables adaptive coalescing of shuffle partitions.
Fix the error in the code to enable adaptive query execution.
spark.conf.set("spark.sql.adaptive.enabled", [1])
The configuration value must be a string, so it should be "true" with double quotes.
Fill both blanks to create a dictionary of adaptive query configs.
configs = {"spark.sql.adaptive.enabled": [1], "spark.sql.adaptive.coalescePartitions.enabled": [2]The first config enables adaptive query execution with "true". The second disables coalescing with "false".
Fill all three blanks to set adaptive configs and print their values.
spark.conf.set("spark.sql.adaptive.enabled", [1]) spark.conf.set("spark.sql.adaptive.skewJoin.enabled", [2]) print(spark.conf.get("spark.sql.adaptive.enabled"), spark.conf.get("spark.sql.adaptive.skewJoin.enabled")) # Output: [3]
Adaptive query execution is enabled with "true". Skew join optimization is disabled with "false". The print shows "true false".
