FAQ
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='a.com', type='360', period='14d');
OK
ds=2011-08-30/domain=a.com/type=360/period=14d
Time taken: 0.268 seconds


hive> alter table a drop partition(ds='2011-08-30',domain='a.com', type='360', period='14d');
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='a.com' and type='360' and period='14d' limit 10;
FAILED: Error in semantic analysis: Invalid partition for table a


hive> desc extended a;
OK
uidstring
dsstring
domainstring
typestring
periodstring

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:8000/user/hive/warehouse/test.db/a, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, 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), FieldSc
hema(name:period, type:string, comment:null)], parameters:{EXTERNAL=TRUE, transient_lastDdlTime=1311332554}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE)
Time taken: 0.049 seconds

Search Discussions

  • Longmans163 at Sep 19, 2011 at 6:04 am
    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/domain=a.com/type=360/period=14d';
    +---------+-------------+------------------+-------------------------------------------------------+--------+--------+
    PART_ID | CREATE_TIME | LAST_ACCESS_TIME | PART_NAME | SD_ID | TBL_ID |
    +---------+-------------+------------------+-------------------------------------------------------+--------+--------+
    423666 | 1316076458 | 0 | ds=2011-08-30/domain=a.com/type=360/period=14d | 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,'a.com',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='a.com', type='360', period='14d');
    OK
    ds=2011-08-30/domain=a.com/type=360/period=14d
    Time taken: 0.268 seconds


    hive> alter table a drop partition(ds='2011-08-30',domain='a.com', 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='a.com' and type='360' and period='14d' limit 10;
    FAILED: Error in semantic analysis: Invalid partition for table a


    hive> desc extended a;
    OK
    uidstring
    dsstring
    domainstring
    typestring
    periodstring

    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, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedSep 15, '11 at 6:41a
activeSep 19, '11 at 6:04a
posts2
users1
websitehive.apache.org

1 user in discussion

Longmans163: 2 posts

People

Translate

site design / logo © 2022 Grokbase