Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Pig question.


Copy link to this message
-
Re: Pig question.
Hi Jamal,

you can write a UDF convert time between different time zones with
following utilities,

java.text.DateFormat;
java.text.SimpleDateFormat;
java.util.Date;
java.util.TimeZone;

Thanks,
TianYi

On Thu, Oct 4, 2012 at 12:53 AM, jamal sasha <[EMAIL PROTECTED]> wrote:

> Hi,
>
>   I have a table in format:
>
> Id: int, amount: float, true_date: chararray, time:chararray,
> state:chararray
>
>
>
> Fortunately, there are only two states in my db.
>
> So if I have a state as “CA” then add +1 to datetime
>
> If state is  “MA”, then add +5 to datetime
>
> And then save the results.
>
> Also a corner case..
>
> While adding.. If due to addition the date changes.. then I have to add +1
> to true_date as well..
>
> Any ideas
>