Hey Raj

Maybe I am misunderstanding the question but u don’t really have to do anything 
fancy to merge

ONE TIME
========
CREATE EXTERNAL TABLE employee (
     empno    BIGINT,
     ename     STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘\t’ ;

ALTER TABLE employee SET LOCATION ‘hdfs://path/to/dir/on/hdfs/containing/files'

Or if u r using AMAZON EMR :
ALTER TABLE employee SET LOCATION 
’s3://bucketname/path/to/subfolder/containing/files'

Now if u keep putting files into this HDFS dir  
‘hdfs://path/to/dir/on/hdfs/containing/files'
U should not have to do anything

Thanks
Warm Regards

Sanjay
linkedin:http://www.linkedin.com/in/subramaniansanjay

From: Raj hadoop <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, March 5, 2014 at 4:16 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Merge records in hive


Hi,



Help required to merge data in hive,



Ex:

Today file

-------------

Empno  ename

1              abc

2              def

3              ghi



Tomorrow file

-----------------

Empno  ename

5              abcd

6              defg

7              ghij





Reg: should not drop the hive table and then create it,what I actually require 
is as shown in the example we have to merge the data,



Thanks,

Raj

Reply via email to