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

seoungho park updated PHOENIX-3893:
-----------------------------------
    Description: 
{code}
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"
{code}
-> It return the correct result

{code}
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"
{code}
-> It return the java.lang.NullPointerException

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

  was:
```
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?


> 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
>
> {code}
> 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"
> {code}
> -> It return the correct result
> {code}
> 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"
> {code}
> -> 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)

Reply via email to