Nick Dimiduk created PHOENIX-2754:
-------------------------------------

             Summary: Add INTERVAL type
                 Key: PHOENIX-2754
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2754
             Project: Phoenix
          Issue Type: Improvement
            Reporter: Nick Dimiduk


We need support for an {{INTERVAL}} datatype. This is a pretty wide feature-gap 
for anyone doing temporal processing with Phoenix. For example, [Oracle 
Interval 
Literals|https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm#i38598],
 [Postgres Interval 
Type|http://www.postgresql.org/docs/9.1/static/datatype-datetime.html].

In the mean time, arithmetic between {{DATE}} and {{TIME}} types with numeric 
values appears to work on units of days, so

{noformat}
> select current_date(), current_date() - 7;
+---------------------------------+---------------------------------+
| DATE '2016-03-09 17:17:58.412'  | DATE '2016-03-02 17:17:58.412'  |
+---------------------------------+---------------------------------+
| 2016-03-09 17:17:58.412         | 2016-03-02 17:17:58.412         |
+---------------------------------+---------------------------------+
{noformat}

and

{noformat}
> select current_date(), current_date() - (4.0/24);
+---------------------------------+---------------------------------+
| DATE '2016-03-09 17:18:19.221'  | DATE '2016-03-09 13:18:19.221'  |
+---------------------------------+---------------------------------+
| 2016-03-09 17:18:19.221         | 2016-03-09 13:18:19.221         |
+---------------------------------+---------------------------------+
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to