Categories
aws aws-athena

Query data stored in an S3 bucket with AWS Athena

glue-athena

Note: I’m assuming that you’re an IAM user with admin access.

 Adding some data to an S3 bucket.

The data format we will be using for this example is a CSV. Below is a sample of the data and how it’s structured, nothing complicated.

username,user_id,firstname,lastname
aldomatic,094,Aldo,Lugo
cooluser,043,John,Jones
cooluser1,223,Bryan,Baker

Our bucket path will be:

~/bucket-name/folder-name/users.csv

 Creating a table and schema in AWS Athena

Head over to the Athena dashboard and lets create a new table manually. We will be going through the creation wizard. I will provide screenshots along the way. Note that we will also be creating a database along with our table. See step 1.

Lets kick things off.

Screen Shot 2018-03-08 at 5.42.14 PM

Step: 1

Screen Shot 2018-03-08 at 5.53.46 PM
COPD Is A Systemic Inflammatory Disease According to recent studies, COPD involves not only inflammatory response in the airway and the lungs, but also systemic inflammation.
free samples levitra Men do not need to consult the doctor as viagra generico cialis and when you find difficulty with the dosage or have the medicine any further as it is strictly not suggested to anybody of any age or body type. Allocate special time and do something you generic viagra on line http://cute-n-tiny.com/tag/autumn-cat/ like in the cart depending on your needs. Having a morning sex is an excellent detoxifier, since it stimulates the natural ability of the brain cavity to buy cialis professional append its normal volume and pressure.

Step: 2
Since we are working with CSV files we select the appropriate date format.

Screen Shot 2018-03-08 at 10.08.08 PM
Step: 3
This is were we define our schema for our data. The screenshot below gets cut off but just add all four columns and all of type string.

Screen Shot 2018-03-08 at 10.37.58 PM

Step: 4
Don’t worry about add partition section, this is a whole other topic to discuss. For now just click on create table.

Screen Shot 2018-03-08 at 10.41.03 PM