Challenge question Now that you know how AWS Glue and Athena work together, try the following exercise
Question:
Challenge question
Now that you know how AWS Glue and Athena work together, try the following exercise to test your knowledge. Your lab instructor has a model solution. However, there is more than one way to solve the challenge.
The Global Historical Climatology Network Daily receives data from around the world. You can download data that describes these stations at the following location: ghcnd-stations.txt. The data dictionary for the observation and stations data is available at the following location: Readme.
Note The ghcnd-stations.txt file is a fixed-width text file. Before you use it with AWS Glue, you must convert it to a comma-separated values (CSV) file, or one of the other file formats that AWS Glue supports. One easy way to convert a text file to a .csv file is to open the text file with a spreadsheet program and then save the file in .csv format. You can also find free utility programs on the internet that can help with this process.
For this challenge, do the following tasks:
- Use AWS Glue to create a table for the weather stations.
- Write a query in Athena to count the number of stations that are not in the US or Canada. The first two characters of the station ID field indicate the country where the station is located. The country codes for the United States is US and the country code for Canada is CA