You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by iwannaplay games <fu...@gmail.com> on 2012/08/01 08:58:05 UTC

Unable to merge 3 tables in hive

Hi all,

I have 3 tables in Mysql and i want to club the data of 3 tables in 1
table of hive.(create a data warehouse).I created table with all the
columns of 3 tables but i am unable to push data in table of
hive.After running an import statement of sqoop i pulled all the
records in hdfs but At a time only one mysql table's data becomes
visible in hive table

I want to view the full table in hive.can anybody help?

Re: Unable to merge 3 tables in hive

Posted by Jarek Jarcec Cecho <ja...@apache.org>.
Hi sir,
could you provide more details of your use case? 

I would be interested to see table structures of all 3 tables on MySQL side, the merged variant in Hive and also it would be helpful to know precise Sqoop commands you're currently using to populate data.

Jarcec

On Wed, Aug 01, 2012 at 12:28:05PM +0530, iwannaplay games wrote:
> Hi all,
> 
> I have 3 tables in Mysql and i want to club the data of 3 tables in 1
> table of hive.(create a data warehouse).I created table with all the
> columns of 3 tables but i am unable to push data in table of
> hive.After running an import statement of sqoop i pulled all the
> records in hdfs but At a time only one mysql table's data becomes
> visible in hive table
> 
> I want to view the full table in hive.can anybody help?

RE: Unable to merge 3 tables in hive

Posted by Matouk Iftissen <mi...@cyres.fr>.
Hi, 
are you using import-all-tables tool ? if this is make sure that you respect consigns of this sqoop tool.
See the sqoop user guide : http://sqoop.apache.org/docs/1.4.0-incubating/SqoopUserGuide.html#id1766722 
For more information.

-----Message d'origine-----
De : iwannaplay games [mailto:funnlearnforkids@gmail.com] 
Envoyé : mercredi 1 août 2012 08:58
À : user; user
Objet : Unable to merge 3 tables in hive

Hi all,

I have 3 tables in Mysql and i want to club the data of 3 tables in 1 table of hive.(create a data warehouse).I created table with all the columns of 3 tables but i am unable to push data in table of hive.After running an import statement of sqoop i pulled all the records in hdfs but At a time only one mysql table's data becomes visible in hive table

I want to view the full table in hive.can anybody help?

Re: Unable to merge 3 tables in hive

Posted by iwannaplay games <fu...@gmail.com>.
thanks i did it by creating 3 external tables and then using this
query to update createddate from users table for a particular userid.

insert overwrite table userinfo
select u.userid,a.createddate from users a join userinfo u on u.userid=a.userid

i can use query option also
I ll try that now :)


On 8/1/12, Bejoy KS <be...@yahoo.com> wrote:
> Hi
>
> If you have run simple table level sqoop import the definitely all the
> tables will be imported separately to hdfs. If you need the data from 3
> tables joined together, frame a proper sql query and use this query in the
> sqoop import (sqoop import has a --query option)
>
> If it is like 3 tables have the same structure and you need to just club the
> data together into single table in hive.
> 1) Import data into hdfs separately for 3 tables.
> 2) Create hive table.
> 3) Use 3 load data statements without Overwrite option to load the imported
> data into same hive table.
>
> Regards
> Bejoy KS
>
> Sent from handheld, please excuse typos.
>
> -----Original Message-----
> From: iwannaplay games <fu...@gmail.com>
> Date: Wed, 1 Aug 2012 12:28:05
> To: user<us...@sqoop.apache.org>; user<us...@hive.apache.org>
> Reply-To: user@hive.apache.org
> Subject: Unable to merge 3 tables in hive
>
> Hi all,
>
> I have 3 tables in Mysql and i want to club the data of 3 tables in 1
> table of hive.(create a data warehouse).I created table with all the
> columns of 3 tables but i am unable to push data in table of
> hive.After running an import statement of sqoop i pulled all the
> records in hdfs but At a time only one mysql table's data becomes
> visible in hive table
>
> I want to view the full table in hive.can anybody help?
>

Re: Unable to merge 3 tables in hive

Posted by Bejoy KS <be...@yahoo.com>.
Hi

If you have run simple table level sqoop import the definitely all the tables will be imported separately to hdfs. If you need the data from 3 tables joined together, frame a proper sql query and use this query in the sqoop import (sqoop import has a --query option)

If it is like 3 tables have the same structure and you need to just club the data together into single table in hive.
1) Import data into hdfs separately for 3 tables.
2) Create hive table.
3) Use 3 load data statements without Overwrite option to load the imported data into same hive table.

Regards
Bejoy KS

Sent from handheld, please excuse typos.

-----Original Message-----
From: iwannaplay games <fu...@gmail.com>
Date: Wed, 1 Aug 2012 12:28:05 
To: user<us...@sqoop.apache.org>; user<us...@hive.apache.org>
Reply-To: user@hive.apache.org
Subject: Unable to merge 3 tables in hive

Hi all,

I have 3 tables in Mysql and i want to club the data of 3 tables in 1
table of hive.(create a data warehouse).I created table with all the
columns of 3 tables but i am unable to push data in table of
hive.After running an import statement of sqoop i pulled all the
records in hdfs but At a time only one mysql table's data becomes
visible in hive table

I want to view the full table in hive.can anybody help?