Which method adds or replaces a Spark DataFrame column?
makeColumnwithColumnadd_cellinstallColumn
Answer: 2
Type: single
Time: 40
Explanation: withColumn returns a DataFrame with the new or replaced column.
Which expression calculates total_bytes?
service + regionevent_time / servicebytes_in + bytes_outlatency_ms - service
Answer: 3 Type: single Time: 40 Explanation: Total bytes are incoming bytes plus outgoing bytes.
Why does the tutorial calculate error_rate only when request_count > 0?
- To sort services alphabetically
- To stop Spark
- To remove timestamp columns
- To avoid division by zero
Answer: 4 Type: single Time: 50 Explanation: Safe division prevents errors or invalid results when the denominator is zero.
Which function extracts the hour from a timestamp column?
hourweekdayschemarank
Answer: 1
Type: single
Time: 40
Explanation: hour(col("event_time")) extracts the hour value.
Which function converts a timestamp into a date?
to_folderto_dateto_schemato_rank
Answer: 2
Type: single
Time: 40
Explanation: to_date extracts the date part from a timestamp.
What does when(...).otherwise(...) help create?
- A permanent database
- A virtual environment
- Conditional values such as
latency_band - A CSV header
Answer: 3
Type: single
Time: 50
Explanation: when is used for conditional column logic.
Which SQL query finds total requests by hour?
SELECT event_hour FROM service_events_enriched STOP BY request_countSUM event_hour USING request_countGROUP request_count FROM event_hourSELECT event_hour, SUM(request_count) FROM service_events_enriched GROUP BY event_hour
Answer: 4 Type: single Time: 60 Explanation: The query groups rows by hour and sums request counts.
Which final project feature is most similar to event_hour?
symboltrade_hourcloseprice_range
Answer: 2 Type: single Time: 45 Explanation: Both are hour features extracted from timestamp columns.
Which final project feature is most similar to latency_band?
quote_volumeopen_timecandle_directiontrade_count
Answer: 3 Type: single Time: 45 Explanation: Both are category labels created from row-level conditions.
Why register service_events_enriched after creating derived columns?
- So the raw CSV is deleted
- So Java is installed
- So Spark no longer needs memory
- So SQL queries can use the new columns
Answer: 4 Type: single Time: 50 Explanation: Registering the enriched DataFrame lets Spark SQL query the derived columns.