You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "seoungho park (JIRA)" <ji...@apache.org> on 2017/05/29 07:56:04 UTC

[jira] [Created] (PHOENIX-3893) Using the TO_TIMESTAMP function in a WHERE statement causes an error.

seoungho park created PHOENIX-3893:
--------------------------------------

             Summary: Using the TO_TIMESTAMP function in a WHERE statement causes an error.
                 Key: PHOENIX-3893
                 URL: https://issues.apache.org/jira/browse/PHOENIX-3893
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.10.0
            Reporter: seoungho park


```
SELECT 
  "type", COUNT(DISTINCT "offset")
FROM "log"
LEFT OUTER JOIN (SELECT TO_TIMESTAMP('2017-05-29 02:53:00') AS "start") AS "s" ON 1=1
LEFT OUTER JOIN (SELECT TO_TIMESTAMP('2017-05-29 02:55:00') AS "end") AS "e" ON 1=1
WHERE "date" >= "start" AND "date" < "end"
GROUP BY "type"
```
-> It return the correct result

```
SELECT 
  "type", COUNT(DISTINCT "offset")
FROM "log"
WHERE "date" >= TO_TIMESTAMP('2017-05-29 02:53:00') AND "date" < TO_TIMESTAMP('2017-05-29 02:55:00')
GROUP BY "type"
```
-> It return the java.lang.NullPointerException

The second query should return the same result as above, and why is this issue happening?



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)