hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From unmesha sreeveni <unmeshab...@gmail.com>
Subject Fwd: Values getting duplicated in Hive table(Partitioned)
Date Mon, 17 Nov 2014 07:31:14 GMT
In non partitioned table I am getting the correct values.

Is my update query wrong?

INSERT OVERWRITE TABLE Unm_Parti_Trail PARTITION (Department = 'A') SELECT
employeeid,firstname,designation, CASE WHEN employeeid=19 THEN '50000 ELSE
salary END AS salary FROM Unm_Parti_Trail;


What I tried to include in the query is , In partion with department = A,
update employeeid =19 's salary with 50000

Is that query statement wrong? and the replication is not affected to dept
B and C


---------- Forwarded message ----------
From: hadoop hive <hadoophive@gmail.com>
Date: Mon, Nov 17, 2014 at 10:08 AM
Subject: Re: Values getting duplicated in Hive table(Partitioned)
To: user@hive.apache.org


Can you check your select query to run on non partitioned tables. Check if
it's giving correct values.

Same as for dept. B
 On Nov 17, 2014 10:03 AM, "unmesha sreeveni" <unmeshabiju@gmail.com> wrote:

> ***I created a Hive table with *non*- *partitioned* and using select
> query I inserted data into *Partioned* Hive table.
>
> On Mon, Nov 17, 2014 at 10:00 AM, unmesha sreeveni <unmeshabiju@gmail.com>
> wrote:
>
>> I created a Hive table with *partition* and inserted data into Partioned
>> Hive table.
>>
>> Refered site
>> <https://blog.safaribooksonline.com/2012/12/03/tip-partitioning-data-in-hive/>
>>
>>    1.
>>
>>    *Initially created one Non -partioned table and then using select
>>    query and loaded data into partioned table. Is there an alternate way?*
>>    2.
>>
>>    *By following above link my partioned table contains duplicate
>>    values. Below are the setps*
>>
>> This is my Sample employee dataset:link1 <http://pastebin.com/tVh16Yxt>
>>
>> I tried the following queries: link2 <http://pastebin.com/U2yykWpy>
>>
>> But after updating a value in Hive table,the values are getting
>> duplicated.
>>
>> 7       Nirmal  Tech    12000   A
>> 7       Nirmal  Tech    12000   B
>>
>> Nirmal is placed in Department *A* only
>> ​,​
>> but it is duplicated to department *B*.
>>
>> And Once I update a column value in middle I am getting NULL values
>> displayed,while updating last column it is fine.
>>
>> Am I doing any thing wrong.
>> Please suggest.--
>>
>
> --
*Thanks & Regards *


*Unmesha Sreeveni U.B*
*Hadoop, Bigdata Developer*
*Centre for Cyber Security | Amrita Vishwa Vidyapeetham*
http://www.unmeshasreeveni.blogspot.in/

Mime
View raw message