Skip to content

Instantly share code, notes, and snippets.

@yalisassoon
Last active January 2, 2016 09:29
Show Gist options
  • Save yalisassoon/8283380 to your computer and use it in GitHub Desktop.
Save yalisassoon/8283380 to your computer and use it in GitHub Desktop.
Hive table definition to analyze Amazon Cloudfront Access logs
CREATE EXTERNAL TABLE cloudfront_access_logs (
dt STRING,
tm STRING,
x_edge_location STRING,
sc_bytes STRING,
c_ip STRING,
cs_method STRING,
cs_host STRING,
cs_uri_stem STRING,
sc_status STRING,
cs_referer STRING,
cs_user_agent STRING,
cs_uri_query STRING,
cs_cookie STRING,
x_edge_result_type STRING,
x_edge_request_id STRING,
x_edge_host_header STRING,
cs_protocol STRING,
cs_bytes STRING
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION 's3n://.../' ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment