【发布时间】:2016-03-09 21:49:24
【问题描述】:
我在 Hive 中创建了一个表,其中加载了数据。
我想在 Column spec: DoJ where value is 2012 上对其进行分区
我用过:
ALTER TABLE employee
ADD PARTITION (year='2012')
location '/home/rvarun/2012/part2012';
我收到错误:
FAILED: Error in metadata: table is not partitioned but partition spec exists: {year=2012}
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
我对 Hive 有点陌生,所以请见谅。
我的表是这样的:
1001 Varun 100000 Security Lead 2011
1002 Saloni 85000 Database Admin 2012
1003 Karan 90000 Network Engineer Lead 2012
1004 Pratik 98000 TrainEngine Driver 2012
1005 Ashish 120000 Senior Consultant 2013
1006 Gautam 70000 Salesforce Consultant 2013
1007 Mohit Sacheva 20000 Peon 2014
谁能告诉我为什么会这样? TIA
【问题讨论】:
-
请提供您的创建表脚本和show partitions employee的输出
-
我的解决方案有效吗?