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.thong...@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
>
>
>
>

Reply via email to