hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From longmans163 <>
Subject Re:Metadata for partition can't read or drop!
Date Mon, 19 Sep 2011 06:03:59 GMT
hi, all.
After I check the table in hive, I found the reason for this issue.
mysql> select * from PARTITIONS where PART_NAME='ds=2011-08-30/';
| PART_ID | CREATE_TIME | LAST_ACCESS_TIME | PART_NAME                                   
         | SD_ID  | TBL_ID |
|  423666 |  1316076458 |                0 | ds=2011-08-30/
| 437876 |  10646 | 
1 row in set (0.01 sec)

I can't find any records of the PART_ID:423666  at table PARTITION_KEY_VALS.

mysql> select * from PARTITION_KEY_VALS where PART_ID = 423666;
Empty set (0.00 sec)

that's the problem: the table PARTITION_KEY_VALS isn't update, while I'm creating the partition
for my table(why hive don't do this in a atom way?)

So, I insert values for PARTITION_KEY_VALS with PART_ID = 423666 like this:
mysql> insert into PARTITION_KEY_VALS values(423666,'2011-08-30',0),(423666,'',1),(423666,'360',2),(423666,'14d',3);
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 0

At 2011-09-15 14:41:12, <> wrote:

hi, all. 
    Currently, I get an exception: I can show partitons for the table 'a', but can't read
or drop it, anybody know why?
ps: I am using mysql to store the metadata for hive.

hive> show partitions a partition(ds='2011-08-30',domain='', type='360', period='14d');
Time taken: 0.268 seconds

hive> alter table a drop partition(ds='2011-08-30',domain='', type='360', period='14d');
                                            &n bsp;    
FAILED: Error in metadata: Invalid partition for table a
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

hive> select * from a where ds='2011-08-30' and domain='' and type='360' and period='14d'
limit 10;                                       
FAILED: Error in semantic analysis: Invalid partition for table a

hive> desc extended a;
Detailed Table InformationTable(tableName:a, dbName:test, owner:admin, createTime:1311332554,
lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:uid, type:string,
comment:null), FieldSchema(name:ds, type:string, comment:null), FieldSchema(name:domain, type:string,
comment:null), FieldSchema(name:type, type:string, comment:null), FieldSchema(name:period,
type:string, comment:null)], location:hdfs://namenode.hp:8 000/user/hive/warehouse/test.db/a,
compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe,
parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:ds,
type:string, comment:null), FieldSchema(name:domain, type:string, comment:null), FieldSchema(name:type,
type:string, comment:null), FieldS
 chema(name:period, type:string, comment:null)], parameters:{EXTERNAL=TRUE, transient_lastDdlTime=1311332554},
viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE)
Time taken: 0.049 seconds

View raw message