You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Ramakrishna Nalam <nr...@gmail.com> on 2012/12/10 05:12:41 UTC

Piggybank date time functions

Hi,

We're using the date and time functions of PiggyBank, and were slightly
surprised to see all of the timezones set to UTC, most of them not
configurable.

Given we want to get it working with IST (+5:30), how should we do it?
Get it working of course mean all functions (daydiff, hourdiff etc.)

One option that we see is replacing all DateTimeZone.UTC to
ISOHelper.DEFAULT_DATE_TIME_ZONE and change
the ISOHelper.DEFAULT_DATE_TIME_ZONE to the desired timezone.

Is there any other way?
Just wanted to make sure we're reading into things correctly here.


Thanks,
Rama.

Re: Piggybank date time functions

Posted by Jonathan Coveney <jc...@gmail.com>.
I did not implement those UDF's... I imagine the reason for rigorously
using UTC instead of system time is because that can introduce subtle bugs
where your servers have a different time than your client and it can be
hard to debug, etc. It would be pretty easy to add support for timezone to
those UDF's, however, either with custom constructors or with config
variables etc.


2012/12/10 Ramakrishna Nalam <nr...@gmail.com>

> Soliciting suggestions, really think there was some strong reason for using
> UTC in all places so consistently!
> The classes I'm referring to are mainly in the
> org/apache/pig/piggybank/evaluation/datetime/ package.
>
> Regards,
> Rama.
>
>
>
> On Mon, Dec 10, 2012 at 9:42 AM, Ramakrishna Nalam
> <nr...@gmail.com>wrote:
>
> >
> > Hi,
> >
> > We're using the date and time functions of PiggyBank, and were slightly
> > surprised to see all of the timezones set to UTC, most of them not
> > configurable.
> >
> > Given we want to get it working with IST (+5:30), how should we do it?
> > Get it working of course mean all functions (daydiff, hourdiff etc.)
> >
> > One option that we see is replacing all DateTimeZone.UTC to
> > ISOHelper.DEFAULT_DATE_TIME_ZONE and change
> > the ISOHelper.DEFAULT_DATE_TIME_ZONE to the desired timezone.
> >
> > Is there any other way?
> > Just wanted to make sure we're reading into things correctly here.
> >
> >
> > Thanks,
> > Rama.
> >
>

Re: Piggybank date time functions

Posted by Ramakrishna Nalam <nr...@gmail.com>.
Soliciting suggestions, really think there was some strong reason for using
UTC in all places so consistently!
The classes I'm referring to are mainly in the
org/apache/pig/piggybank/evaluation/datetime/ package.

Regards,
Rama.



On Mon, Dec 10, 2012 at 9:42 AM, Ramakrishna Nalam
<nr...@gmail.com>wrote:

>
> Hi,
>
> We're using the date and time functions of PiggyBank, and were slightly
> surprised to see all of the timezones set to UTC, most of them not
> configurable.
>
> Given we want to get it working with IST (+5:30), how should we do it?
> Get it working of course mean all functions (daydiff, hourdiff etc.)
>
> One option that we see is replacing all DateTimeZone.UTC to
> ISOHelper.DEFAULT_DATE_TIME_ZONE and change
> the ISOHelper.DEFAULT_DATE_TIME_ZONE to the desired timezone.
>
> Is there any other way?
> Just wanted to make sure we're reading into things correctly here.
>
>
> Thanks,
> Rama.
>