Last active
March 13, 2019 15:34
-
-
Save ogiogi93/f4896d4c0f1078c4a441a5f1d4edc22c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE EXTERNAL TABLE IF NOT EXISTS sample_aijcif01.apache_logs ( | |
host STRING, | |
identity STRING, | |
user STRING, | |
time STRING, | |
request STRING, | |
status STRING, | |
size STRING, | |
referer STRING, | |
agent STRING | |
) PARTITIONED BY ( | |
year int, | |
month int, | |
day int, | |
hour int | |
) | |
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe' | |
WITH SERDEPROPERTIES ( | |
"input.regex" = "([^ ]*) ([^ ]*) ([^ ]*) (-|\\[[^\\]]*\\]) ([^ \"]*|\"[^\"]*\") (-|[0-9]*) (-|[0-9]*)(?: ([^ \"]*|\"[^\"]*\") ([^ \"]*|\"[^\"]*\"))?", | |
"output.format.string" = "%1$s %2$s %3$s %4$s %5$s %6$s %7$s %8$s %9$s" | |
) LOCATION 's3://<bucket名>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment