You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Gabriel Reid (JIRA)" <ji...@apache.org> on 2014/03/16 08:20:29 UTC

[jira] [Resolved] (PHOENIX-439) Compare between dates in phoenix 1.2.1

     [ https://issues.apache.org/jira/browse/PHOENIX-439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gabriel Reid resolved PHOENIX-439.
----------------------------------

    Resolution: Fixed

Bulk resolve of closed issues imported from GitHub. This status was reached by first re-opening all closed imported issues and then resolving them in bulk.

> Compare between dates in phoenix 1.2.1
> --------------------------------------
>
>                 Key: PHOENIX-439
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-439
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: dhaeb
>
> Hello, 
> i want to compare dates values in the where clause. Is such a query possible in the current stable version 1.2.1: 
> ```sql
> select * 
> from TABLE 
> where DATE_FIELD='2012-06-09 04:21:50' 
> ```
> I didn't found any documentation on that. I checked the ANTLR grammar and it don't seem like there is a parsing into a date literal in this literal function:
> (from PhoenixSQL.g)
> ```
> // Get a string, integer, double, date, boolean, or NULL value.
> literal returns [LiteralParseNode ret]
>     :   s=STRING_LITERAL { ret = factory.literal(s.getText()); }
>     |   n=int_literal { ret = n; }
>     |   d=DECIMAL {
>             try {
>                 ret = factory.literal(new BigDecimal(d.getText()));
>             } catch (NumberFormatException e) { // Shouldn't happen since we just parsed a decimal
>                 throwRecognitionException(d);
>             }
>         }
>     |   NULL {ret = factory.literal(null);}
>     |   TRUE {ret = factory.literal(Boolean.TRUE);} 
>     |   FALSE {ret = factory.literal(Boolean.FALSE);}
>     ;
> ```



--
This message was sent by Atlassian JIRA
(v6.2#6252)