You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by murali krishna p <mu...@icloud.com> on 2014/08/17 10:03:36 UTC
ToDate and GetMonth function help
Trying to read a table column defined as datetime in my pig script as follows
load ‘/tmp.psv’ using PIgStore() (open_dte : chararray);
Later I wanted to use GetMonth in pig script as followes.
Temp_dt = ToDate(open_dte, ‘yyyy-MM-DD’);
Month = GetMonth(temp_dt);
I am getting an error asking to use a explicit cast. Any insights in this issue?
Greatly appreciate your help!!
Thanks,
Murali
Re: ToDate and GetMonth function help
Posted by inelu nagamallikarjuna <ma...@gmail.com>.
Hai,
Write UDF in java to extract the month and any other values from your input
string....
Thanks
Naga
On Aug 18, 2014 8:49 PM, "murali krishna p" <mu...@icloud.com>
wrote:
>
>
> Trying to read a table column defined as datetime in my pig script as
> follows
>
> load ‘/tmp.psv’ using PIgStore() (open_dte : chararray);
>
>
> Later I wanted to use GetMonth in pig script as followes.
>
> Temp_dt = ToDate(open_dte, ‘yyyy-MM-DD’);
> Month = GetMonth(temp_dt);
>
>
> I am getting an error asking to use a explicit cast. Any insights in this
> issue?
>
> Greatly appreciate your help!!
>
>
> Thanks,
> Murali
>
>