You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by Ankit Agarwal <an...@olacabs.com> on 2016/01/15 14:07:36 UTC

Invalid date current_date() function

Hi,

I am trying Apache Phoenix with Hbase. When I run try to get current time
using select current_time(), its giving me some weird value.
(292278994-08-17 07:12:55.807). Similarly for current_date() or now()
query. I am not able to understand what does this mean, and how to get the
current time (as we get from mysql now() function). Because of this I am
unable to set the data type for view column as Date or Timestamp, as its
doing some weird conversion.

Can anyone help me figure out a solution for this.

Thanks & Regards

-- 


*Ankit Agarwal*
*Software Development EngineerPh. No. +91-8095470278*

Re: Invalid date current_date() function

Posted by James Taylor <ja...@apache.org>.
I posted a patch for a fix on PHOENIX-2611 which will be part of our 4.7.0
release. In the meantime, you can do the following query instead: SELECT
CURRENT_DATE() FROM SYSTEM.CATALOG LIMIT 1;


On Mon, Jan 18, 2016 at 5:29 PM, Nick Dimiduk <nd...@apache.org> wrote:

> I filed https://issues.apache.org/jira/browse/PHOENIX-2611
>
> On Mon, Jan 18, 2016 at 5:07 PM, Nick Dimiduk <nd...@apache.org> wrote:
>
> > I'm testing from 4.6.x
> >
> > On Mon, Jan 18, 2016 at 5:06 PM, James Taylor <ja...@apache.org>
> > wrote:
> >
> >> Definitely a bug/regression. This is on the latest, I assume? Yes,
> please
> >> file a JIRA.
> >>
> >> On Mon, Jan 18, 2016 at 5:04 PM, Nick Dimiduk <nd...@apache.org>
> >> wrote:
> >>
> >> > Poking at this,
> >> >
> >> > > select current_time();
> >> > +-------------------------------------+
> >> > | TIME '292278994-08-17 07:12:55.807' |
> >> > +-------------------------------------+
> >> > | 292278994-08-17 07:12:55.807        |
> >> > +-------------------------------------+
> >> > 1 row selected (79.6 seconds)
> >> >
> >> > With a debugger attached, CurrentTime(long) is being invoked with
> >> > Long.MAX_VALUE, presumably from HConstants.LATEST_TIMESTAMP via the
> >> > StatementContext.
> >> >
> >> > On Mon, Jan 18, 2016 at 4:52 PM, James Taylor <jamestaylor@apache.org
> >
> >> > wrote:
> >> >
> >> > > Ankit,
> >> > > Would you mind posting a sample of the code you're using to get date
> >> > value?
> >> > > Are you using resultSet.getDate(1)?
> >> > > Thanks,
> >> > > James
> >> > >
> >> > > On Mon, Jan 18, 2016 at 4:49 PM, Nick Dimiduk <nd...@apache.org>
> >> > wrote:
> >> > >
> >> > > > Hi Ankit,
> >> > > >
> >> > > > This looks like a bug to me too. Do you mind filing a JIRA for
> this?
> >> > > >
> >> > > > Thanks,
> >> > > > Nick
> >> > > >
> >> > > > On Fri, Jan 15, 2016 at 5:07 AM, Ankit Agarwal <
> >> > > ankit.agarwal2@olacabs.com
> >> > > > >
> >> > > > wrote:
> >> > > >
> >> > > > > Hi,
> >> > > > >
> >> > > > > I am trying Apache Phoenix with Hbase. When I run try to get
> >> current
> >> > > time
> >> > > > > using select current_time(), its giving me some weird value.
> >> > > > > (292278994-08-17 07:12:55.807). Similarly for current_date() or
> >> now()
> >> > > > > query. I am not able to understand what does this mean, and how
> to
> >> > get
> >> > > > the
> >> > > > > current time (as we get from mysql now() function). Because of
> >> this I
> >> > > am
> >> > > > > unable to set the data type for view column as Date or
> Timestamp,
> >> as
> >> > > its
> >> > > > > doing some weird conversion.
> >> > > > >
> >> > > > > Can anyone help me figure out a solution for this.
> >> > > > >
> >> > > > > Thanks & Regards
> >> > > > >
> >> > > > > --
> >> > > > >
> >> > > > >
> >> > > > > *Ankit Agarwal*
> >> > > > > *Software Development EngineerPh. No. +91-8095470278*
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> >
> >
>

Re: Invalid date current_date() function

Posted by Nick Dimiduk <nd...@apache.org>.
I filed https://issues.apache.org/jira/browse/PHOENIX-2611

On Mon, Jan 18, 2016 at 5:07 PM, Nick Dimiduk <nd...@apache.org> wrote:

> I'm testing from 4.6.x
>
> On Mon, Jan 18, 2016 at 5:06 PM, James Taylor <ja...@apache.org>
> wrote:
>
>> Definitely a bug/regression. This is on the latest, I assume? Yes, please
>> file a JIRA.
>>
>> On Mon, Jan 18, 2016 at 5:04 PM, Nick Dimiduk <nd...@apache.org>
>> wrote:
>>
>> > Poking at this,
>> >
>> > > select current_time();
>> > +-------------------------------------+
>> > | TIME '292278994-08-17 07:12:55.807' |
>> > +-------------------------------------+
>> > | 292278994-08-17 07:12:55.807        |
>> > +-------------------------------------+
>> > 1 row selected (79.6 seconds)
>> >
>> > With a debugger attached, CurrentTime(long) is being invoked with
>> > Long.MAX_VALUE, presumably from HConstants.LATEST_TIMESTAMP via the
>> > StatementContext.
>> >
>> > On Mon, Jan 18, 2016 at 4:52 PM, James Taylor <ja...@apache.org>
>> > wrote:
>> >
>> > > Ankit,
>> > > Would you mind posting a sample of the code you're using to get date
>> > value?
>> > > Are you using resultSet.getDate(1)?
>> > > Thanks,
>> > > James
>> > >
>> > > On Mon, Jan 18, 2016 at 4:49 PM, Nick Dimiduk <nd...@apache.org>
>> > wrote:
>> > >
>> > > > Hi Ankit,
>> > > >
>> > > > This looks like a bug to me too. Do you mind filing a JIRA for this?
>> > > >
>> > > > Thanks,
>> > > > Nick
>> > > >
>> > > > On Fri, Jan 15, 2016 at 5:07 AM, Ankit Agarwal <
>> > > ankit.agarwal2@olacabs.com
>> > > > >
>> > > > wrote:
>> > > >
>> > > > > Hi,
>> > > > >
>> > > > > I am trying Apache Phoenix with Hbase. When I run try to get
>> current
>> > > time
>> > > > > using select current_time(), its giving me some weird value.
>> > > > > (292278994-08-17 07:12:55.807). Similarly for current_date() or
>> now()
>> > > > > query. I am not able to understand what does this mean, and how to
>> > get
>> > > > the
>> > > > > current time (as we get from mysql now() function). Because of
>> this I
>> > > am
>> > > > > unable to set the data type for view column as Date or Timestamp,
>> as
>> > > its
>> > > > > doing some weird conversion.
>> > > > >
>> > > > > Can anyone help me figure out a solution for this.
>> > > > >
>> > > > > Thanks & Regards
>> > > > >
>> > > > > --
>> > > > >
>> > > > >
>> > > > > *Ankit Agarwal*
>> > > > > *Software Development EngineerPh. No. +91-8095470278*
>> > > > >
>> > > >
>> > >
>> >
>>
>
>

Re: Invalid date current_date() function

Posted by Nick Dimiduk <nd...@apache.org>.
I'm testing from 4.6.x

On Mon, Jan 18, 2016 at 5:06 PM, James Taylor <ja...@apache.org>
wrote:

> Definitely a bug/regression. This is on the latest, I assume? Yes, please
> file a JIRA.
>
> On Mon, Jan 18, 2016 at 5:04 PM, Nick Dimiduk <nd...@apache.org> wrote:
>
> > Poking at this,
> >
> > > select current_time();
> > +-------------------------------------+
> > | TIME '292278994-08-17 07:12:55.807' |
> > +-------------------------------------+
> > | 292278994-08-17 07:12:55.807        |
> > +-------------------------------------+
> > 1 row selected (79.6 seconds)
> >
> > With a debugger attached, CurrentTime(long) is being invoked with
> > Long.MAX_VALUE, presumably from HConstants.LATEST_TIMESTAMP via the
> > StatementContext.
> >
> > On Mon, Jan 18, 2016 at 4:52 PM, James Taylor <ja...@apache.org>
> > wrote:
> >
> > > Ankit,
> > > Would you mind posting a sample of the code you're using to get date
> > value?
> > > Are you using resultSet.getDate(1)?
> > > Thanks,
> > > James
> > >
> > > On Mon, Jan 18, 2016 at 4:49 PM, Nick Dimiduk <nd...@apache.org>
> > wrote:
> > >
> > > > Hi Ankit,
> > > >
> > > > This looks like a bug to me too. Do you mind filing a JIRA for this?
> > > >
> > > > Thanks,
> > > > Nick
> > > >
> > > > On Fri, Jan 15, 2016 at 5:07 AM, Ankit Agarwal <
> > > ankit.agarwal2@olacabs.com
> > > > >
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I am trying Apache Phoenix with Hbase. When I run try to get
> current
> > > time
> > > > > using select current_time(), its giving me some weird value.
> > > > > (292278994-08-17 07:12:55.807). Similarly for current_date() or
> now()
> > > > > query. I am not able to understand what does this mean, and how to
> > get
> > > > the
> > > > > current time (as we get from mysql now() function). Because of
> this I
> > > am
> > > > > unable to set the data type for view column as Date or Timestamp,
> as
> > > its
> > > > > doing some weird conversion.
> > > > >
> > > > > Can anyone help me figure out a solution for this.
> > > > >
> > > > > Thanks & Regards
> > > > >
> > > > > --
> > > > >
> > > > >
> > > > > *Ankit Agarwal*
> > > > > *Software Development EngineerPh. No. +91-8095470278*
> > > > >
> > > >
> > >
> >
>

Re: Invalid date current_date() function

Posted by James Taylor <ja...@apache.org>.
Definitely a bug/regression. This is on the latest, I assume? Yes, please
file a JIRA.

On Mon, Jan 18, 2016 at 5:04 PM, Nick Dimiduk <nd...@apache.org> wrote:

> Poking at this,
>
> > select current_time();
> +-------------------------------------+
> | TIME '292278994-08-17 07:12:55.807' |
> +-------------------------------------+
> | 292278994-08-17 07:12:55.807        |
> +-------------------------------------+
> 1 row selected (79.6 seconds)
>
> With a debugger attached, CurrentTime(long) is being invoked with
> Long.MAX_VALUE, presumably from HConstants.LATEST_TIMESTAMP via the
> StatementContext.
>
> On Mon, Jan 18, 2016 at 4:52 PM, James Taylor <ja...@apache.org>
> wrote:
>
> > Ankit,
> > Would you mind posting a sample of the code you're using to get date
> value?
> > Are you using resultSet.getDate(1)?
> > Thanks,
> > James
> >
> > On Mon, Jan 18, 2016 at 4:49 PM, Nick Dimiduk <nd...@apache.org>
> wrote:
> >
> > > Hi Ankit,
> > >
> > > This looks like a bug to me too. Do you mind filing a JIRA for this?
> > >
> > > Thanks,
> > > Nick
> > >
> > > On Fri, Jan 15, 2016 at 5:07 AM, Ankit Agarwal <
> > ankit.agarwal2@olacabs.com
> > > >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > I am trying Apache Phoenix with Hbase. When I run try to get current
> > time
> > > > using select current_time(), its giving me some weird value.
> > > > (292278994-08-17 07:12:55.807). Similarly for current_date() or now()
> > > > query. I am not able to understand what does this mean, and how to
> get
> > > the
> > > > current time (as we get from mysql now() function). Because of this I
> > am
> > > > unable to set the data type for view column as Date or Timestamp, as
> > its
> > > > doing some weird conversion.
> > > >
> > > > Can anyone help me figure out a solution for this.
> > > >
> > > > Thanks & Regards
> > > >
> > > > --
> > > >
> > > >
> > > > *Ankit Agarwal*
> > > > *Software Development EngineerPh. No. +91-8095470278*
> > > >
> > >
> >
>

Re: Invalid date current_date() function

Posted by Nick Dimiduk <nd...@apache.org>.
Poking at this,

> select current_time();
+-------------------------------------+
| TIME '292278994-08-17 07:12:55.807' |
+-------------------------------------+
| 292278994-08-17 07:12:55.807        |
+-------------------------------------+
1 row selected (79.6 seconds)

With a debugger attached, CurrentTime(long) is being invoked with
Long.MAX_VALUE, presumably from HConstants.LATEST_TIMESTAMP via the
StatementContext.

On Mon, Jan 18, 2016 at 4:52 PM, James Taylor <ja...@apache.org>
wrote:

> Ankit,
> Would you mind posting a sample of the code you're using to get date value?
> Are you using resultSet.getDate(1)?
> Thanks,
> James
>
> On Mon, Jan 18, 2016 at 4:49 PM, Nick Dimiduk <nd...@apache.org> wrote:
>
> > Hi Ankit,
> >
> > This looks like a bug to me too. Do you mind filing a JIRA for this?
> >
> > Thanks,
> > Nick
> >
> > On Fri, Jan 15, 2016 at 5:07 AM, Ankit Agarwal <
> ankit.agarwal2@olacabs.com
> > >
> > wrote:
> >
> > > Hi,
> > >
> > > I am trying Apache Phoenix with Hbase. When I run try to get current
> time
> > > using select current_time(), its giving me some weird value.
> > > (292278994-08-17 07:12:55.807). Similarly for current_date() or now()
> > > query. I am not able to understand what does this mean, and how to get
> > the
> > > current time (as we get from mysql now() function). Because of this I
> am
> > > unable to set the data type for view column as Date or Timestamp, as
> its
> > > doing some weird conversion.
> > >
> > > Can anyone help me figure out a solution for this.
> > >
> > > Thanks & Regards
> > >
> > > --
> > >
> > >
> > > *Ankit Agarwal*
> > > *Software Development EngineerPh. No. +91-8095470278*
> > >
> >
>

Re: Invalid date current_date() function

Posted by James Taylor <ja...@apache.org>.
Ankit,
Would you mind posting a sample of the code you're using to get date value?
Are you using resultSet.getDate(1)?
Thanks,
James

On Mon, Jan 18, 2016 at 4:49 PM, Nick Dimiduk <nd...@apache.org> wrote:

> Hi Ankit,
>
> This looks like a bug to me too. Do you mind filing a JIRA for this?
>
> Thanks,
> Nick
>
> On Fri, Jan 15, 2016 at 5:07 AM, Ankit Agarwal <ankit.agarwal2@olacabs.com
> >
> wrote:
>
> > Hi,
> >
> > I am trying Apache Phoenix with Hbase. When I run try to get current time
> > using select current_time(), its giving me some weird value.
> > (292278994-08-17 07:12:55.807). Similarly for current_date() or now()
> > query. I am not able to understand what does this mean, and how to get
> the
> > current time (as we get from mysql now() function). Because of this I am
> > unable to set the data type for view column as Date or Timestamp, as its
> > doing some weird conversion.
> >
> > Can anyone help me figure out a solution for this.
> >
> > Thanks & Regards
> >
> > --
> >
> >
> > *Ankit Agarwal*
> > *Software Development EngineerPh. No. +91-8095470278*
> >
>

Re: Invalid date current_date() function

Posted by Nick Dimiduk <nd...@apache.org>.
Hi Ankit,

This looks like a bug to me too. Do you mind filing a JIRA for this?

Thanks,
Nick

On Fri, Jan 15, 2016 at 5:07 AM, Ankit Agarwal <an...@olacabs.com>
wrote:

> Hi,
>
> I am trying Apache Phoenix with Hbase. When I run try to get current time
> using select current_time(), its giving me some weird value.
> (292278994-08-17 07:12:55.807). Similarly for current_date() or now()
> query. I am not able to understand what does this mean, and how to get the
> current time (as we get from mysql now() function). Because of this I am
> unable to set the data type for view column as Date or Timestamp, as its
> doing some weird conversion.
>
> Can anyone help me figure out a solution for this.
>
> Thanks & Regards
>
> --
>
>
> *Ankit Agarwal*
> *Software Development EngineerPh. No. +91-8095470278*
>