· 7 years ago · Oct 15, 2018, 07:00 PM
1hive> use question3;
2OK
3Time taken: 0.016 seconds
4hive> drop table if exists question3;
5OK
6Time taken: 0.162 seconds
7hive> create external table question3 (
8 > month_name string
9 > , day string
10 > , time string
11 > , node string
12 > , process string
13 > , log_msg string
14 > )
15 > partitioned by (year int, month int)
16 > row format serde 'org.apache.hadoop.hive.serde2.RegexSerDe'
17 > with serdeproperties (
18 > "input.regex" = "^(\S+)\s+(\S+)\s+(\S+:\S+:\S+)\s+(\S+)\s+(\S+)\s+(.*$)"
19 > , "output.format.string" = "%1$s %2$s %3$s %4$s %5$s"
20 > )
21 > stored as textfile
22 > location 'hdfs:/user/hive/question3';
23OK
24Time taken: 0.178 seconds
25hive> alter table question3 add if not exists partition (year=2016, month=06)
26 > location "/home/tobi/question3/question3_jul16.log";
27FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:java.io.IOException: Got exception: org.apache.hadoop.security.AccessControlException Permission denied: user=root, access=WRITE, inode="/":hdfs:supergroup:drwxrwxr-x
28 at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkFsPermission(DefaultAuthorizationProvider.java:279)
29 at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.check(DefaultAuthorizationProvider.java:260)