· 8 years ago · Dec 20, 2017, 12:44 AM
1CREATE EXTERNAL TABLE IF NOT EXISTS sampledb.widget_access_log (
2 `date` date,
3 `time` string,
4 `location` string,
5 `bytes` int,
6 `request_ip` string,
7 `method` string,
8 `host` string,
9 `uri` string,
10 `status` int,
11 `referer` string,
12 `useragent` string,
13 `uri_query` string,
14 `cookie` string,
15 `edge_type` string,
16 `edget_requiest_id` string,
17 `host_header` string,
18 `cs_protocol` string,
19 `cs_bytes` int,
20 `time_taken` string,
21 `x_forwarded_for` string,
22 `ssl_protocol` string,
23 `ssl_cipher` string,
24 `result_type` string,
25 `protocol` string
26)
27ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
28WITH SERDEPROPERTIES (
29 'input.regex' = '^(?!#.*)(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s*(\\S*)'
30) LOCATION 's3://cloudfront.newscred-dev.com/widgets/'