Skip to content

Instantly share code, notes, and snippets.

@reecestart
Created May 10, 2017 20:58
Show Gist options
  • Save reecestart/000985367a80d0c965e0430a0f87c8a7 to your computer and use it in GitHub Desktop.
Save reecestart/000985367a80d0c965e0430a0f87c8a7 to your computer and use it in GitHub Desktop.
Create Athena Table for CSVs
CREATE EXTERNAL TABLE IF NOT EXISTS athenadatabaseforcsvs.athenatableforcsvs (
aws_account_id string,
name string,
email string,
status string,
category string,
description string,
refreshed string,
processed string,
flagged string,
percent_flagged string,
ta_proposed_actions string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
'separatorChar' = ',',
'quoteChar' = '\"',
'escapeChar' = '\\'
)
STORED AS TEXTFILE
LOCATION 's3://bucket-with-csvs/';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment