You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by yo...@wipro.com on 2012/07/12 12:16:52 UTC

hive opload shows NULL from hdfs

Hi all,

I am trying to upload files from hdfs to hive table,

file in hdfs are imported by sqoop tool from mysql having table structure

******************************************

no    name   result  class
---------------------------------
6      vishu   pass    7
7      hana   pass    6

******************************************

in hdfs it shows there records as

hadoop dfs -cat /try/part/part-m-00003
6,vishu,pass,7
7,hana,pass,6

now I have created table in hive ( using same datatype as were in mysql)

create table parthp (no INT , name STRING , result STRING , class INT )  ;

and used this command to upload data into hive table

hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into table parthp ;

and it results.

hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into table parthp ;
Loading data to table default.parthp
OK
Time taken: 0.145 seconds

now if i do

hive> select * from parthp;
it results

hive> select * from parthp;
OK
NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL
Time taken: 0.056 seconds

why is it showing null, I have used the same data types as were in MySql,

(no INT(11) --> no INT, name VARCHAR(45) ---> name STRING , result VARCHAR(45) ----> result STRING ,  class INT(11) ---> class INT)

Please suggest and help

Thanks & Regards
Yogesh Kumar




Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com

RE: hive opload shows NULL from hdfs

Posted by yo...@wipro.com.
Yes Mohammad it worked fine,

Thank you :-)

Regards
Yogesh Kumar
______________________________________
From: Mohammad Tariq [dontariq@gmail.com]
Sent: Thursday, July 12, 2012 4:34 PM
To: user@hive.apache.org
Subject: Re: hive opload shows NULL from hdfs

Did it work fine??

Regards,
    Mohammad Tariq


On Thu, Jul 12, 2012 at 4:33 PM,  <yo...@wipro.com> wrote:
> Thanks Mohammad :-)
>
> Regards
> Yogesh Kumar
> ________________________________________
> From: Mohammad Tariq [dontariq@gmail.com]
> Sent: Thursday, July 12, 2012 3:52 PM
> To: user@hive.apache.org
> Subject: Re: hive opload shows NULL from hdfs
>
> Create your table using this command :
>
> create table parthp (no INT , name STRING , result STRING , class INT
> )  row format delimited fields terminated by "," ;
>
> In hive the delimiters are assumed to be ^A(ctrl-a), by default.
>
> Regards,
>     Mohammad Tariq
>
>
> On Thu, Jul 12, 2012 at 3:46 PM,  <yo...@wipro.com> wrote:
>> Hi all,
>>
>> I am trying to upload files from hdfs to hive table,
>>
>> file in hdfs are imported by sqoop tool from mysql having table structure
>>
>> ******************************************
>>
>> no    name   result  class
>> ---------------------------------
>> 6      vishu   pass    7
>> 7      hana   pass    6
>>
>> ******************************************
>>
>> in hdfs it shows there records as
>>
>> hadoop dfs -cat /try/part/part-m-00003
>> 6,vishu,pass,7
>> 7,hana,pass,6
>>
>> now I have created table in hive ( using same datatype as were in mysql)
>>
>> create table parthp (no INT , name STRING , result STRING , class INT )  ;
>>
>> and used this command to upload data into hive table
>>
>> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
>> table parthp ;
>>
>> and it results.
>>
>> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
>> table parthp ;
>> Loading data to table default.parthp
>> OK
>> Time taken: 0.145 seconds
>>
>> now if i do
>>
>> hive> select * from parthp;
>> it results
>>
>> hive> select * from parthp;
>> OK
>> NULL    NULL    NULL    NULL
>> NULL    NULL    NULL    NULL
>> Time taken: 0.056 seconds
>>
>> why is it showing null, I have used the same data types as were in MySql,
>>
>> (no INT(11) --> no INT, name VARCHAR(45) ---> name STRING , result
>> VARCHAR(45) ----> result STRING ,  class INT(11) ---> class INT)
>>
>> Please suggest and help
>>
>> Thanks & Regards
>> Yogesh Kumar
>>
>>
>>
>> Please do not print this email unless it is absolutely necessary.
>>
>> The information contained in this electronic message and any attachments to
>> this message are intended for the exclusive use of the addressee(s) and may
>> contain proprietary, confidential or privileged information. If you are not
>> the intended recipient, you should not disseminate, distribute or copy this
>> e-mail. Please notify the sender immediately and destroy all copies of this
>> message and any attachments.
>>
>> WARNING: Computer viruses can be transmitted via email. The recipient should
>> check this email and any attachments for the presence of viruses. The
>> company accepts no liability for any damage caused by any virus transmitted
>> by this email.
>>
>> www.wipro.com
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>
> www.wipro.com

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com

Re: hive opload shows NULL from hdfs

Posted by Mohammad Tariq <do...@gmail.com>.
Did it work fine??

Regards,
    Mohammad Tariq


On Thu, Jul 12, 2012 at 4:33 PM,  <yo...@wipro.com> wrote:
> Thanks Mohammad :-)
>
> Regards
> Yogesh Kumar
> ________________________________________
> From: Mohammad Tariq [dontariq@gmail.com]
> Sent: Thursday, July 12, 2012 3:52 PM
> To: user@hive.apache.org
> Subject: Re: hive opload shows NULL from hdfs
>
> Create your table using this command :
>
> create table parthp (no INT , name STRING , result STRING , class INT
> )  row format delimited fields terminated by "," ;
>
> In hive the delimiters are assumed to be ^A(ctrl-a), by default.
>
> Regards,
>     Mohammad Tariq
>
>
> On Thu, Jul 12, 2012 at 3:46 PM,  <yo...@wipro.com> wrote:
>> Hi all,
>>
>> I am trying to upload files from hdfs to hive table,
>>
>> file in hdfs are imported by sqoop tool from mysql having table structure
>>
>> ******************************************
>>
>> no    name   result  class
>> ---------------------------------
>> 6      vishu   pass    7
>> 7      hana   pass    6
>>
>> ******************************************
>>
>> in hdfs it shows there records as
>>
>> hadoop dfs -cat /try/part/part-m-00003
>> 6,vishu,pass,7
>> 7,hana,pass,6
>>
>> now I have created table in hive ( using same datatype as were in mysql)
>>
>> create table parthp (no INT , name STRING , result STRING , class INT )  ;
>>
>> and used this command to upload data into hive table
>>
>> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
>> table parthp ;
>>
>> and it results.
>>
>> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
>> table parthp ;
>> Loading data to table default.parthp
>> OK
>> Time taken: 0.145 seconds
>>
>> now if i do
>>
>> hive> select * from parthp;
>> it results
>>
>> hive> select * from parthp;
>> OK
>> NULL    NULL    NULL    NULL
>> NULL    NULL    NULL    NULL
>> Time taken: 0.056 seconds
>>
>> why is it showing null, I have used the same data types as were in MySql,
>>
>> (no INT(11) --> no INT, name VARCHAR(45) ---> name STRING , result
>> VARCHAR(45) ----> result STRING ,  class INT(11) ---> class INT)
>>
>> Please suggest and help
>>
>> Thanks & Regards
>> Yogesh Kumar
>>
>>
>>
>> Please do not print this email unless it is absolutely necessary.
>>
>> The information contained in this electronic message and any attachments to
>> this message are intended for the exclusive use of the addressee(s) and may
>> contain proprietary, confidential or privileged information. If you are not
>> the intended recipient, you should not disseminate, distribute or copy this
>> e-mail. Please notify the sender immediately and destroy all copies of this
>> message and any attachments.
>>
>> WARNING: Computer viruses can be transmitted via email. The recipient should
>> check this email and any attachments for the presence of viruses. The
>> company accepts no liability for any damage caused by any virus transmitted
>> by this email.
>>
>> www.wipro.com
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>
> www.wipro.com

RE: hive opload shows NULL from hdfs

Posted by yo...@wipro.com.
Thanks Mohammad :-)

Regards
Yogesh Kumar
________________________________________
From: Mohammad Tariq [dontariq@gmail.com]
Sent: Thursday, July 12, 2012 3:52 PM
To: user@hive.apache.org
Subject: Re: hive opload shows NULL from hdfs

Create your table using this command :

create table parthp (no INT , name STRING , result STRING , class INT
)  row format delimited fields terminated by "," ;

In hive the delimiters are assumed to be ^A(ctrl-a), by default.

Regards,
    Mohammad Tariq


On Thu, Jul 12, 2012 at 3:46 PM,  <yo...@wipro.com> wrote:
> Hi all,
>
> I am trying to upload files from hdfs to hive table,
>
> file in hdfs are imported by sqoop tool from mysql having table structure
>
> ******************************************
>
> no    name   result  class
> ---------------------------------
> 6      vishu   pass    7
> 7      hana   pass    6
>
> ******************************************
>
> in hdfs it shows there records as
>
> hadoop dfs -cat /try/part/part-m-00003
> 6,vishu,pass,7
> 7,hana,pass,6
>
> now I have created table in hive ( using same datatype as were in mysql)
>
> create table parthp (no INT , name STRING , result STRING , class INT )  ;
>
> and used this command to upload data into hive table
>
> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
> table parthp ;
>
> and it results.
>
> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
> table parthp ;
> Loading data to table default.parthp
> OK
> Time taken: 0.145 seconds
>
> now if i do
>
> hive> select * from parthp;
> it results
>
> hive> select * from parthp;
> OK
> NULL    NULL    NULL    NULL
> NULL    NULL    NULL    NULL
> Time taken: 0.056 seconds
>
> why is it showing null, I have used the same data types as were in MySql,
>
> (no INT(11) --> no INT, name VARCHAR(45) ---> name STRING , result
> VARCHAR(45) ----> result STRING ,  class INT(11) ---> class INT)
>
> Please suggest and help
>
> Thanks & Regards
> Yogesh Kumar
>
>
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to
> this message are intended for the exclusive use of the addressee(s) and may
> contain proprietary, confidential or privileged information. If you are not
> the intended recipient, you should not disseminate, distribute or copy this
> e-mail. Please notify the sender immediately and destroy all copies of this
> message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should
> check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> www.wipro.com

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com

Re: hive opload shows NULL from hdfs

Posted by Mohammad Tariq <do...@gmail.com>.
Create your table using this command :

create table parthp (no INT , name STRING , result STRING , class INT
)  row format delimited fields terminated by "," ;

In hive the delimiters are assumed to be ^A(ctrl-a), by default.

Regards,
    Mohammad Tariq


On Thu, Jul 12, 2012 at 3:46 PM,  <yo...@wipro.com> wrote:
> Hi all,
>
> I am trying to upload files from hdfs to hive table,
>
> file in hdfs are imported by sqoop tool from mysql having table structure
>
> ******************************************
>
> no    name   result  class
> ---------------------------------
> 6      vishu   pass    7
> 7      hana   pass    6
>
> ******************************************
>
> in hdfs it shows there records as
>
> hadoop dfs -cat /try/part/part-m-00003
> 6,vishu,pass,7
> 7,hana,pass,6
>
> now I have created table in hive ( using same datatype as were in mysql)
>
> create table parthp (no INT , name STRING , result STRING , class INT )  ;
>
> and used this command to upload data into hive table
>
> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
> table parthp ;
>
> and it results.
>
> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
> table parthp ;
> Loading data to table default.parthp
> OK
> Time taken: 0.145 seconds
>
> now if i do
>
> hive> select * from parthp;
> it results
>
> hive> select * from parthp;
> OK
> NULL    NULL    NULL    NULL
> NULL    NULL    NULL    NULL
> Time taken: 0.056 seconds
>
> why is it showing null, I have used the same data types as were in MySql,
>
> (no INT(11) --> no INT, name VARCHAR(45) ---> name STRING , result
> VARCHAR(45) ----> result STRING ,  class INT(11) ---> class INT)
>
> Please suggest and help
>
> Thanks & Regards
> Yogesh Kumar
>
>
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to
> this message are intended for the exclusive use of the addressee(s) and may
> contain proprietary, confidential or privileged information. If you are not
> the intended recipient, you should not disseminate, distribute or copy this
> e-mail. Please notify the sender immediately and destroy all copies of this
> message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should
> check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> www.wipro.com

Re: hive opload shows NULL from hdfs

Posted by shaik ahamed <sh...@gmail.com>.
Hi yogesh,

           I too come across this prob,give the syntax as :  *load data
local inpath './xyz.txt’ into table abc;*

here yogesh when creating the hive table u have metion the file type  eg
like , or tilda or pipe see below

*create table vender(vender string,supplier string,order_date
string,quantity int) row format delimited fields terminated by ', ' stored
as textfile;
*
this syntax above  is the comma separated file .try it out it will be help
i guess.


Regards
shaik.
On Thu, Jul 12, 2012 at 3:46 PM, <yo...@wipro.com> wrote:

>  Hi all,
>
> I am trying to upload files from hdfs to hive table,
>
> file in hdfs are imported by sqoop tool from mysql having table structure
>
> ******************************************
>
> no    name   result  class
> ---------------------------------
> 6      vishu   pass    7
> 7      hana   pass    6
>
> ******************************************
>
> in hdfs it shows there records as
>
> hadoop dfs -cat /try/part/part-m-00003
> 6,vishu,pass,7
> 7,hana,pass,6
>
> now I have created table in hive ( using same datatype as were in mysql)
>
> create table parthp (no INT , name STRING , result STRING , class INT )  ;
>
> and used this command to upload data into hive table
>
> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
> table parthp ;
>
> and it results.
>
> hive> load data inpath 'hdfs://localhost:9000/try/part/part-m-00003' into
> table parthp ;
> Loading data to table default.parthp
> OK
> Time taken: 0.145 seconds
>
> now if i do
>
> hive> select * from parthp;
> it results
>
> hive> select * from
> parthp;
> OK
> NULL    NULL    NULL    NULL
> NULL    NULL    NULL    NULL
> Time taken: 0.056 seconds
>
> why is it showing null, I have used the same data types as were in MySql,
>
> (no INT(11) --> no INT, name VARCHAR(45) ---> name STRING , result
> VARCHAR(45) ----> result STRING ,  class INT(11) ---> class INT)
>
> Please suggest and help
>
> Thanks & Regards
> Yogesh Kumar
>
>
>
> *Please do not print this email unless it is absolutely necessary. *****
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>
> www.wipro.com
>