Created
June 13, 2017 01:23
-
-
Save andreaskaempf/932232b8267fdc0a00dff56e09b35254 to your computer and use it in GitHub Desktop.
Quick script to get ICAO codes from JSON files
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
// Read all JSON files in the current directory | |
val d = spark.read.json("*.json") | |
// Do the SQL query to get all ICAO codes for the US | |
d.registerTempTable("crap") | |
val regs = sql("select distinct Icao from crap where Cou = 'United States'") | |
// Save to a CSV file | |
regs.write.csv("US_transmitting_ICAO_codes") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment