-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3092c85
commit cc9efaf
Showing
8 changed files
with
96 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
WITH "tmp" AS ( | ||
SET s3_endpoint='fra1.digitaloceanspaces.com'; | ||
|
||
SELECT | ||
SUM(CASE WHEN "happened" = 'FlownWithLadd' THEN 1 ELSE 0 END) AS "with_ladd_count", | ||
SUM(CASE WHEN "happened" = 'FlownWithoutLadd' THEN 1 ELSE 0 END) AS "without_ladd_count" | ||
FROM | ||
read_csv_auto("ladd_10.csv", header = true) | ||
) | ||
SELECT | ||
"with_ladd_count" / ("without_ladd_count" + "with_ladd_count") | ||
FROM "tmp" | ||
"year", | ||
COUNT(DISTINCT("tail_number")) AS "number of aircrafts", | ||
COUNT(*) AS "number of legs", | ||
SUM("co2_emissions")/1000/1000/1000 AS "Mt CO2 emitted", | ||
SUM("distance")/1000/1000/1000 AS "M km flown", | ||
SUM("great_circle_distance")/1000/1000/1000 AS "M km traveled", | ||
SUM("duration")/24 AS "days flown", | ||
SUM("hours_above_30000")/24 AS "days above 30k feet", | ||
SUM("hours_above_40000")/24 AS "days above 40k feet", | ||
FROM read_csv_auto("s3://private-jets/leg/v2/all/year=*/data.csv", header = true) | ||
WHERE "start" < DATE '2024-06-01' | ||
GROUP BY "year" | ||
ORDER BY "year" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters