Complete the code to start the Spark History Server.
start-history-server.sh --dir [1]The Spark History Server reads event logs from the directory specified by the --dir option. By default, event logs are stored in /tmp/spark-events.
Complete the command to enable event logging in Spark configuration.
spark.eventLog.enabled [1] trueIn Spark configuration files, key-value pairs are set using the equals sign =. To enable event logging, set spark.eventLog.enabled=true.
Fix the error in the command to view Spark History Server UI on port 18080.
start-history-server.sh --port [1]The default port for Spark History Server UI is 18080. Using this port allows you to access the UI correctly.
Fill both blanks to configure Spark to save event logs in HDFS.
spark.eventLog.dir [1] hdfs://[2]/spark-logs
To configure Spark event log directory, use = to assign the value. The HDFS path starts with hdfs://namenode/ where namenode is the HDFS master node.
Fill all three blanks to create a dictionary comprehension filtering jobs with duration greater than 1000 ms.
filtered_jobs = [1]: job['duration'] [2] 1000 for job in jobs if job['status'] == [3]
This dictionary comprehension creates a dictionary with job IDs as keys for jobs that succeeded and have duration greater than 1000 ms.
