セクション 1. 章 9
single
Challenge: Analyzing Sales Data with Spark SQL
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
You are given a flights dataset as a list of rows. Load it into a DataFrame, register it as a temporary view, and answer the following using spark.sql(). Store results in the specified variables:
- Find the top 3 routes (unique
AirportFrom+AirportTopairs) by averageLength– store as a list of tuples[(origin, destination, avg_length), ...]intop_routes_by_length; - For each airline, find the flight with the longest
Lengthusing a window function withrow_number()– store as a DataFrame inlongest_flight_per_airlinewith columnsAirline,Flight,Length; - Count how many delayed flights (
Delay == 1) perDayOfWeek– store as a list of tuples[(day_of_week, count), ...]sorted byDayOfWeekascending indelays_by_dow.
Print all results.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 9
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください