You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Sumit Nigam <su...@yahoo.com> on 2015/10/05 05:45:41 UTC

Current time from Hbase

Hi,
How can I get the current time from Hbase? 
I can use Phoenix function current_time(). One way would be to query this column against any table as - SELECT CURRENT_TIME() AS TIME FROM TABL LIMIT 1; Or, I could possibly create a single row, single column table and query against that table for current time.
Is there a better way than how I am describing it above? 
Thanks,Sumit


Re: Current time from Hbase

Posted by James Taylor <ja...@apache.org>.
The feature (PHOENIX-922) was added as of 4.5.0, so you should be fine.
Thanks,
James

On Sun, Oct 4, 2015 at 8:59 PM, Sumit Nigam <su...@yahoo.com> wrote:

> Thank you James. Unfortunately, I am using 4.5.1 and moving up might take
> some time.
> In that case, I assume creating a single column, single row table would be
> better?
>
> Thanks again.
>
> ------------------------------
> *From:* James Taylor <ja...@apache.org>
> *To:* user <us...@phoenix.apache.org>; Sumit Nigam <su...@yahoo.com>
> *Sent:* Monday, October 5, 2015 9:20 AM
> *Subject:* Re: Current time from Hbase
>
> In the latest Phoenix release (4.5.2), you can just do the following, as
> the FROM clause is now optional:
> SELECT CURRENT_TIME()
>
>
>
> On Sun, Oct 4, 2015 at 8:45 PM, Sumit Nigam <su...@yahoo.com> wrote:
>
> Hi,
>
> How can I get the current time from Hbase?
>
> I can use Phoenix function current_time(). One way would be to query this
> column against any table as - SELECT CURRENT_TIME() AS TIME FROM TABL LIMIT
> 1; Or, I could possibly create a single row, single column table and query
> against that table for current time.
>
> Is there a better way than how I am describing it above?
>
> Thanks,
> Sumit
>
>
>
>
>
>

Re: Current time from Hbase

Posted by Sumit Nigam <su...@yahoo.com>.
Thank you James. Unfortunately, I am using 4.5.1 and moving up might take some time. In that case, I assume creating a single column, single row table would be better? 
Thanks again.
      From: James Taylor <ja...@apache.org>
 To: user <us...@phoenix.apache.org>; Sumit Nigam <su...@yahoo.com> 
 Sent: Monday, October 5, 2015 9:20 AM
 Subject: Re: Current time from Hbase
   
In the latest Phoenix release (4.5.2), you can just do the following, as the FROM clause is now optional:SELECT CURRENT_TIME()


On Sun, Oct 4, 2015 at 8:45 PM, Sumit Nigam <su...@yahoo.com> wrote:

Hi,
How can I get the current time from Hbase? 
I can use Phoenix function current_time(). One way would be to query this column against any table as - SELECT CURRENT_TIME() AS TIME FROM TABL LIMIT 1; Or, I could possibly create a single row, single column table and query against that table for current time.
Is there a better way than how I am describing it above? 
Thanks,Sumit





  

Re: Current time from Hbase

Posted by James Taylor <ja...@apache.org>.
In the latest Phoenix release (4.5.2), you can just do the following, as
the FROM clause is now optional:
SELECT CURRENT_TIME()

On Sun, Oct 4, 2015 at 8:45 PM, Sumit Nigam <su...@yahoo.com> wrote:

> Hi,
>
> How can I get the current time from Hbase?
>
> I can use Phoenix function current_time(). One way would be to query this
> column against any table as - SELECT CURRENT_TIME() AS TIME FROM TABL LIMIT
> 1; Or, I could possibly create a single row, single column table and query
> against that table for current time.
>
> Is there a better way than how I am describing it above?
>
> Thanks,
> Sumit
>
>
>