[
https://issues.apache.org/jira/browse/PHOENIX-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14497334#comment-14497334
]
Abhishek Sreenivasa commented on PHOENIX-1707:
----------------------------------------------
[~lawr.eskin], I'm not able to reproduce this issue. I used Apache Phoenix
4.3.1 and HBase 0.98.6.
Here's the set of SQL statements I used to verify that it's working:
1. Create new alarms history table.
DROP TABLE IF EXISTS ALARMSHISTORY;
CREATE TABLE IF NOT EXISTS
ALARMSHISTORY (ID VARCHAR NOT NULL PRIMARY KEY,
REGDATE UNSIGNED_DATE);
2. Upsert some entries
UPSERT INTO ALARMSHISTORY VALUES ('001', TO_DATE('2015-03-06 00:00:00'));
UPSERT INTO ALARMSHISTORY VALUES ('002', TO_DATE('2015-03-07 00:00:00'));
3. Run your query
SELECT FLOOR(REGDATE, 'DAY'), TO_DATE('2015-03-06', 'yyyy-MM-dd')
FROM "ALARMSHISTORY" AS "ALARMSHISTORY"
WHERE FLOOR(REGDATE, 'DAY') = TO_DATE('2015-03-06', 'yyyy-MM-dd');
Step 3 ran successfully. If you are able to reproduce the issue consistently,
could you please let me know what you are doing differently?
Thanks,
Abhishek
> Compare (where) DATE<> UNSIGNED_DATE raise NPE
> ----------------------------------------------
>
> Key: PHOENIX-1707
> URL: https://issues.apache.org/jira/browse/PHOENIX-1707
> Project: Phoenix
> Issue Type: Bug
> Environment: Phoenix 4.3, hbase 0.98.6
> Reporter: Lavrenty Eskin
> Assignee: Abhishek Sreenivasa
> Labels: Newbie
>
> select
> FLOOR(REGDATE, 'DAY'), <<== UNSIGNED_DATE
> TO_DATE('2015-03-06', 'yyyy-MM-dd') <<== DATE
> from
> "ALARMSHISTORY" as "ALARMSHISTORY"
> where
> FLOOR(REGDATE, 'DAY') = TO_DATE('2015-03-06', 'yyyy-MM-dd'); <<== raise
> java.lang.NullPointerException
> (!) There are no NULLs in REGDATE
> Ways to resolve:
> a) Implement TO_UNSIGNED_DATE function
> b) Implement correct compare function DATE<> UNSIGNED_DATE
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)