hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Devopam Mittra <devo...@gmail.com>
Subject Re: Unable to retrieve date
Date Fri, 30 Jan 2015 06:15:13 GMT
please consider not writing a new UDF and instead using the following
syntax with built-in UDFs itself .

SELECT
from_unixtime(unix_timestamp('07/Dec/2014:23:59:04','dd/MMM/yyyy:HH:mm:ss'),
'dd-MMM-yyyy HH:mm:ss')
FROM twitter_data_raw LIMIT 1;

feel free to play around with the formats to get desired results

regards
Devopam


On Thu, Jan 29, 2015 at 3:12 PM, Nagarjuna Vissarapu <
nagarjuna.viss@gmail.com> wrote:

> Hi All,
>
> I wrote hive UDF to convert
>
> 07/Dec/2014:23:59:04 to  07-Dec-2014 23:59:04
>
> I attached UDF. PFA ...
>
> I added jar to hive and created temporary function
>
>
> *stringTotimestampQuery: select stringTotimestamp(date) from rm_get limit
> 1;*
> *Result: *
> [image: Inline image 1]
>
> *Query: select to_date(stringTotimestamp(date)) from rm_get limit 1;*
> *Result: Null*
>
> What may be the issue?
> --
> With Thanks & Regards
> Nagarjuna Vissarapu
> 9052179339
>
>


-- 
Devopam Mittra
Life and Relations are not binary

Mime
View raw message