hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Subramanian, Sanjay (HQP)" <sanjay.subraman...@roberthalf.com>
Subject Re: Merge records in hive
Date Wed, 05 Mar 2014 20:32:34 GMT
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 <raj.hadoop@gmail.com<mailto:raj.hadoop@gmail.com>>
Reply-To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>>
Date: Wednesday, March 5, 2014 at 4:16 AM
To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>>
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

Mime
View raw message