You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Abhishek Gayakwad <a....@gmail.com> on 2013/03/09 21:00:49 UTC

Error while table creation

while trying to create external table in oozie hive action, I am
getting following error, hive version is 0.9.0


Caused by: javax.jdo.JDODataStoreException: Insert of object
"org.apache.hadoop.hive.metastore.model.MColumnDescriptor@46c1dc0b"
using statement "INSERT INTO `CDS` (`CD_ID`) VALUES (?)" failed :
Duplicate entry 'XXXXX' for key 'PRIMARY'
NestedThrowables:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Duplicate entry 'XXXXX' for key 'PRIMARY'
	at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:313)
	at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:660)
	at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:680)
	at org.apache.hadoop.hive.metastore.ObjectStore.createTable(ObjectStore.java:617)
	... 43 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Duplicate entry 'XXXXX' for key 'PRIMARY'


Thanks,
Abhishek

Re: Error while table creation

Posted by Ramki Palle <ra...@gmail.com>.
Please use "if not exists" clause and let us know if it works.

I am wondering if a table exists already in your database with the same
name.

-Ramki.


On Sat, Mar 9, 2013 at 11:23 PM, Abhishek Gayakwad <a....@gmail.com>wrote:

> it is an old installation, we recently upgraded hive 0.7.0 to 0.9.0
>
> and we are not using "if not exists" clause
>
>
> On Sun, Mar 10, 2013 at 4:37 AM, Ramki Palle <ra...@gmail.com>wrote:
>
>> Just wondering if your create table syntax include "if not exists" such
>> as
>>
>> CREATE EXTERNAL TABLE IF NOT EXISTS my_table (
>>
>> ...
>> ...
>> ...
>> )
>>
>>
>>
>> On Sun, Mar 10, 2013 at 2:34 AM, Viral Bajaria <vi...@gmail.com>wrote:
>>
>>> Is this is a new installation of Hive or did you upgrade ? How many
>>> tables do you already have ?
>>>
>>>
>>> On Sat, Mar 9, 2013 at 12:00 PM, Abhishek Gayakwad <a.gayakwad@gmail.com
>>> > wrote:
>>>
>>>> while trying to create external table in oozie hive action, I am getting following error, hive version is 0.9.0
>>>>
>>>>
>>>>
>>>> Caused by: javax.jdo.JDODataStoreException: Insert of object "org.apache.hadoop.hive.metastore.model.MColumnDescriptor@46c1dc0b" using statement "INSERT INTO `CDS` (`CD_ID`) VALUES (?)" failed : Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>> NestedThrowables:
>>>> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>> 	at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:313)
>>>> 	at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:660)
>>>> 	at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:680)
>>>> 	at org.apache.hadoop.hive.metastore.ObjectStore.createTable(ObjectStore.java:617)
>>>> 	... 43 more
>>>> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>>
>>>>
>>>> Thanks,
>>>> Abhishek
>>>>
>>>>
>>>
>>
>

Re: Error while table creation

Posted by Abhishek Gayakwad <a....@gmail.com>.
Duplicate CD_ID in CDS table was linked to an old table which was created
before hive 0.7.0 to 0.9.0 migration, this might be causing this issue. I
am still debugging this issue , looks like there was some problem in
upgrade.


On Sun, Mar 10, 2013 at 8:47 PM, Dean Wampler <
dean.wampler@thinkbiganalytics.com> wrote:

> If you upgrade Hive, you have to do a upgrade/migration on the metastore
> database. There are scripts that come with hive distributions for this. If
> you're starting from scratch, you could just drop the old database.
>
>
> On Sun, Mar 10, 2013 at 1:23 AM, Abhishek Gayakwad <a....@gmail.com>wrote:
>
>> it is an old installation, we recently upgraded hive 0.7.0 to 0.9.0
>>
>> and we are not using "if not exists" clause
>>
>>
>> On Sun, Mar 10, 2013 at 4:37 AM, Ramki Palle <ra...@gmail.com>wrote:
>>
>>> Just wondering if your create table syntax include "if not exists" such
>>> as
>>>
>>> CREATE EXTERNAL TABLE IF NOT EXISTS my_table (
>>>
>>> ...
>>> ...
>>> ...
>>> )
>>>
>>>
>>>
>>> On Sun, Mar 10, 2013 at 2:34 AM, Viral Bajaria <vi...@gmail.com>wrote:
>>>
>>>> Is this is a new installation of Hive or did you upgrade ? How many
>>>> tables do you already have ?
>>>>
>>>>
>>>> On Sat, Mar 9, 2013 at 12:00 PM, Abhishek Gayakwad <
>>>> a.gayakwad@gmail.com> wrote:
>>>>
>>>>> while trying to create external table in oozie hive action, I am getting following error, hive version is 0.9.0
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Caused by: javax.jdo.JDODataStoreException: Insert of object "org.apache.hadoop.hive.metastore.model.MColumnDescriptor@46c1dc0b" using statement "INSERT INTO `CDS` (`CD_ID`) VALUES (?)" failed : Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>>> NestedThrowables:
>>>>> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>>> 	at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:313)
>>>>> 	at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:660)
>>>>> 	at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:680)
>>>>> 	at org.apache.hadoop.hive.metastore.ObjectStore.createTable(ObjectStore.java:617)
>>>>> 	... 43 more
>>>>> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Abhishek
>>>>>
>>>>>
>>>>
>>>
>>
>
>
> --
> *Dean Wampler, Ph.D.*
> thinkbiganalytics.com
> +1-312-339-1330
>
>

Re: Error while table creation

Posted by Dean Wampler <de...@thinkbiganalytics.com>.
If you upgrade Hive, you have to do a upgrade/migration on the metastore
database. There are scripts that come with hive distributions for this. If
you're starting from scratch, you could just drop the old database.

On Sun, Mar 10, 2013 at 1:23 AM, Abhishek Gayakwad <a....@gmail.com>wrote:

> it is an old installation, we recently upgraded hive 0.7.0 to 0.9.0
>
> and we are not using "if not exists" clause
>
>
> On Sun, Mar 10, 2013 at 4:37 AM, Ramki Palle <ra...@gmail.com>wrote:
>
>> Just wondering if your create table syntax include "if not exists" such
>> as
>>
>> CREATE EXTERNAL TABLE IF NOT EXISTS my_table (
>>
>> ...
>> ...
>> ...
>> )
>>
>>
>>
>> On Sun, Mar 10, 2013 at 2:34 AM, Viral Bajaria <vi...@gmail.com>wrote:
>>
>>> Is this is a new installation of Hive or did you upgrade ? How many
>>> tables do you already have ?
>>>
>>>
>>> On Sat, Mar 9, 2013 at 12:00 PM, Abhishek Gayakwad <a.gayakwad@gmail.com
>>> > wrote:
>>>
>>>> while trying to create external table in oozie hive action, I am getting following error, hive version is 0.9.0
>>>>
>>>>
>>>>
>>>> Caused by: javax.jdo.JDODataStoreException: Insert of object "org.apache.hadoop.hive.metastore.model.MColumnDescriptor@46c1dc0b" using statement "INSERT INTO `CDS` (`CD_ID`) VALUES (?)" failed : Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>> NestedThrowables:
>>>> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>> 	at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:313)
>>>> 	at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:660)
>>>> 	at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:680)
>>>> 	at org.apache.hadoop.hive.metastore.ObjectStore.createTable(ObjectStore.java:617)
>>>> 	... 43 more
>>>> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>>
>>>>
>>>> Thanks,
>>>> Abhishek
>>>>
>>>>
>>>
>>
>


-- 
*Dean Wampler, Ph.D.*
thinkbiganalytics.com
+1-312-339-1330

Re: Error while table creation

Posted by Abhishek Gayakwad <a....@gmail.com>.
it is an old installation, we recently upgraded hive 0.7.0 to 0.9.0

and we are not using "if not exists" clause


On Sun, Mar 10, 2013 at 4:37 AM, Ramki Palle <ra...@gmail.com> wrote:

> Just wondering if your create table syntax include "if not exists" such as
>
> CREATE EXTERNAL TABLE IF NOT EXISTS my_table (
>
> ...
> ...
> ...
> )
>
>
>
> On Sun, Mar 10, 2013 at 2:34 AM, Viral Bajaria <vi...@gmail.com>wrote:
>
>> Is this is a new installation of Hive or did you upgrade ? How many
>> tables do you already have ?
>>
>>
>> On Sat, Mar 9, 2013 at 12:00 PM, Abhishek Gayakwad <a....@gmail.com>wrote:
>>
>>> while trying to create external table in oozie hive action, I am getting following error, hive version is 0.9.0
>>>
>>>
>>> Caused by: javax.jdo.JDODataStoreException: Insert of object "org.apache.hadoop.hive.metastore.model.MColumnDescriptor@46c1dc0b" using statement "INSERT INTO `CDS` (`CD_ID`) VALUES (?)" failed : Duplicate entry 'XXXXX' for key 'PRIMARY'
>>> NestedThrowables:
>>> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>>> 	at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:313)
>>> 	at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:660)
>>> 	at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:680)
>>> 	at org.apache.hadoop.hive.metastore.ObjectStore.createTable(ObjectStore.java:617)
>>> 	... 43 more
>>> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>>>
>>>
>>> Thanks,
>>> Abhishek
>>>
>>>
>>
>

Re: Error while table creation

Posted by Ramki Palle <ra...@gmail.com>.
Just wondering if your create table syntax include "if not exists" such as

CREATE EXTERNAL TABLE IF NOT EXISTS my_table (

...
...
...
)



On Sun, Mar 10, 2013 at 2:34 AM, Viral Bajaria <vi...@gmail.com>wrote:

> Is this is a new installation of Hive or did you upgrade ? How many tables
> do you already have ?
>
>
> On Sat, Mar 9, 2013 at 12:00 PM, Abhishek Gayakwad <a....@gmail.com>wrote:
>
>> while trying to create external table in oozie hive action, I am getting following error, hive version is 0.9.0
>>
>>
>> Caused by: javax.jdo.JDODataStoreException: Insert of object "org.apache.hadoop.hive.metastore.model.MColumnDescriptor@46c1dc0b" using statement "INSERT INTO `CDS` (`CD_ID`) VALUES (?)" failed : Duplicate entry 'XXXXX' for key 'PRIMARY'
>> NestedThrowables:
>> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>> 	at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:313)
>> 	at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:660)
>> 	at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:680)
>> 	at org.apache.hadoop.hive.metastore.ObjectStore.createTable(ObjectStore.java:617)
>> 	... 43 more
>> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>>
>>
>> Thanks,
>> Abhishek
>>
>>
>

Re: Error while table creation

Posted by Viral Bajaria <vi...@gmail.com>.
Is this is a new installation of Hive or did you upgrade ? How many tables
do you already have ?

On Sat, Mar 9, 2013 at 12:00 PM, Abhishek Gayakwad <a....@gmail.com>wrote:

> while trying to create external table in oozie hive action, I am getting following error, hive version is 0.9.0
>
>
> Caused by: javax.jdo.JDODataStoreException: Insert of object "org.apache.hadoop.hive.metastore.model.MColumnDescriptor@46c1dc0b" using statement "INSERT INTO `CDS` (`CD_ID`) VALUES (?)" failed : Duplicate entry 'XXXXX' for key 'PRIMARY'
> NestedThrowables:
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
> 	at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:313)
> 	at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:660)
> 	at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:680)
> 	at org.apache.hadoop.hive.metastore.ObjectStore.createTable(ObjectStore.java:617)
> 	... 43 more
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'XXXXX' for key 'PRIMARY'
>
>
> Thanks,
> Abhishek
>
>