我跑不了 ALTER TABLE MY_EXTERNAL_TABLE RECOVER PARTITIONS;
在Hive1.2上,但是当我运行 MSCK REPAIR TABLE MY_EXTERNAL_TABLE
它只是列出配置单元元存储中不存在的分区,而不是添加它。基于hive exec的源代码,我可以在下面看到 org/apache/hadoop/hive/ql/parse/HiveParser.g:1001:1
恢复分区语法中没有令牌匹配。
请让我知道,如果有一种方法,以恢复所有的分区后,创建外部表hive1.2。
的堆栈跟踪 ALTER TABLE MY_EXTERNAL_TABLE RECOVER PARTITIONS;
:
NoViableAltException(26@[])
at org.apache.hadoop.hive.ql.parse.HiveParser.alterTableStatementSuffix(HiveParser.java:7946)
at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatement(HiveParser.java:7409)
at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2693)
at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1658)
at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1117)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:202)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:431)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:316)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1189)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1237)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1126)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1116)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:216)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:168)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:379)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:739)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:684)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:624)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
FAILED: ParseException line 1:45 cannot recognize input near 'recover' 'partitions' '<EOF>' in alter table statement
注意:我使用s3作为存储,hdp2.4用于hadoop和hive1.2。
1条答案
按热度按时间33qvvth11#
hi在花了一段时间调试后得到了修复,原因是它没有通过msck添加分区,因为我的分区名是驼峰大小写的(文件系统区分大小写,但hive将所有分区列名都视为小写),但是一旦我的分区路径是小写的,它就会像一个魔咒一样工作。