You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Patcharee Thongtra <Pa...@uni.no> on 2014/06/02 21:23:58 UTC

java.lang.TypeNotPresentException: Type timestamp not present

Hi,

I am using hive 0.13 and I created a table with a column date in 
timestamp format.
When I used pig script to store data into the table I got exception 
java.lang.TypeNotPresentException: Type timestamp not present

This is my pig script

result = FOREACH result_raw GENERATE generate ToDate(dateString, 
'yyyy-MM-dd HH:mm:ss') as date:DateTime, zone, z, u, v, th, qv, ph;
store result into 'fino31' using org.apache.hcatalog.pig.HCatStorer();

This link 
https://cwiki.apache.org/confluence/display/Hive/HCatalog+LoadStore#HCatalogLoadStore-DataTypesSupportedinHive0.13.0andLaterReleases.1 
mentions that hive 0.13 supports timestamp and in pig we should provide 
DateTime to store in timestamp column. I did as mentioned but I got the 
exception.

Any suggestion is appreciated.

Patcharee




Re: java.lang.TypeNotPresentException: Type timestamp not present

Posted by Eugene Koifman <ek...@hortonworks.com>.
instead of org.apache.hcatalog.pig.HCatStorer() use
org.apache.hive.hcatalog.pig.HCatStorer()


On Mon, Jun 2, 2014 at 12:54 PM, Rahul Channe <dr...@googlemail.com>
wrote:

> Try loading the data in a temporary hive table with datatype as String,
> then you can populate the data in the final table
>
>  insert into table timestamp_example select
> from_unixtime(unix_timestamp(v_time ,'MM/dd/yyyy HH:mm') ) from
> timestamp_example_temp;
>
>
> On Mon, Jun 2, 2014 at 3:23 PM, Patcharee Thongtra <
> Patcharee.Thongtra@uni.no> wrote:
>
>> Hi,
>>
>> I am using hive 0.13 and I created a table with a column date in
>> timestamp format.
>> When I used pig script to store data into the table I got exception
>> java.lang.TypeNotPresentException: Type timestamp not present
>>
>> This is my pig script
>>
>> result = FOREACH result_raw GENERATE generate ToDate(dateString,
>> 'yyyy-MM-dd HH:mm:ss') as date:DateTime, zone, z, u, v, th, qv, ph;
>> store result into 'fino31' using org.apache.hcatalog.pig.HCatStorer();
>>
>> This link https://cwiki.apache.org/confluence/display/Hive/
>> HCatalog+LoadStore#HCatalogLoadStore-DataTypesSupportedinHive0.13.
>> 0andLaterReleases.1 mentions that hive 0.13 supports timestamp and in
>> pig we should provide DateTime to store in timestamp column. I did as
>> mentioned but I got the exception.
>>
>> Any suggestion is appreciated.
>>
>> Patcharee
>>
>>
>>
>>
>


-- 

Thanks,
Eugene

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Re: java.lang.TypeNotPresentException: Type timestamp not present

Posted by Rahul Channe <dr...@googlemail.com>.
Try loading the data in a temporary hive table with datatype as String,
then you can populate the data in the final table

 insert into table timestamp_example select
from_unixtime(unix_timestamp(v_time ,'MM/dd/yyyy HH:mm') ) from
timestamp_example_temp;


On Mon, Jun 2, 2014 at 3:23 PM, Patcharee Thongtra <
Patcharee.Thongtra@uni.no> wrote:

> Hi,
>
> I am using hive 0.13 and I created a table with a column date in timestamp
> format.
> When I used pig script to store data into the table I got exception
> java.lang.TypeNotPresentException: Type timestamp not present
>
> This is my pig script
>
> result = FOREACH result_raw GENERATE generate ToDate(dateString,
> 'yyyy-MM-dd HH:mm:ss') as date:DateTime, zone, z, u, v, th, qv, ph;
> store result into 'fino31' using org.apache.hcatalog.pig.HCatStorer();
>
> This link https://cwiki.apache.org/confluence/display/Hive/
> HCatalog+LoadStore#HCatalogLoadStore-DataTypesSupportedinHive0.13.
> 0andLaterReleases.1 mentions that hive 0.13 supports timestamp and in pig
> we should provide DateTime to store in timestamp column. I did as mentioned
> but I got the exception.
>
> Any suggestion is appreciated.
>
> Patcharee
>
>
>
>