· 9 years ago · Dec 07, 2016, 11:36 PM
1dbSendQuery(athenaconnect, "CREATE EXTERNAL TABLE IF NOT EXISTS sampledb.elb_logs_raw_native (
2 request_timestamp string,
3 elb_name string,
4 request_ip string,
5 request_port int,
6 backend_ip string,
7 backend_port int,
8 request_processing_time double,
9 backend_processing_time double,
10 client_response_time double,
11 elb_response_code string,
12 backend_response_code string,
13 received_bytes bigint,
14 sent_bytes bigint,
15 request_verb string,
16 url string,
17 protocol string,
18 user_agent string,
19 ssl_cipher string,
20 ssl_protocol string )
21ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
22WITH SERDEPROPERTIES (
23 'serialization.format' = '1','input.regex' = '([^ ]*) ([^ ]*) ([^ ]*):([0-9]*) ([^ ]*):([0-9]*) ([.0-9]*) ([.0-9]*) ([.0-9]*) (-|[0-9]*) (-|[0-9]*) ([-0-9]*) ([-0-9]*) \\\"([^ ]*) ([^ ]*) (- |[^ ]*)\\\" (\"[^\"]*\") ([A-Z0-9-]+) ([A-Za-z0-9.-]*)$' )
24LOCATION 's3://athena-examples/elb/raw/';")