Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created December 13, 2016 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guitarrapc/c07bd7dc52935aee36e78ac178ef940d to your computer and use it in GitHub Desktop.
Save guitarrapc/c07bd7dc52935aee36e78ac178ef940d to your computer and use it in GitHub Desktop.
CREATE EXTERNAL TABLE IF NOT EXISTS s3_accesslogsdb.hogemogeTestTest_contoso_com(
BucketOwner string,
Bucket string,
RequestDateTime string,
RemoteIP string,
Requester string,
RequestID string,
Operation string,
Key string,
RequestURI_operation string,
RequestURI_key string,
RequestURI_httpProtoversion string,
HTTPstatus string,
ErrorCode string,
BytesSent string,
ObjectSize string,
TotalTime string,
TurnAroundTime string,
Referrer string,
UserAgent string,
VersionId string)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = '1',
'input.regex' = '([^ ]*) ([^ ]*) \\[(.*?)\\] ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) \\\"([^ ]*) ([^ ]*) (- |[^ ]*)\\\" (-|[0-9]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) (\"[^\"]*\") ([^ ]*)$'
) LOCATION 's3://hogemogeTestTest.contoso.com/logs/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment