Cloudera Labs
Provide feedback on Cloudera Labs
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

[Phoenix] date column value does not compare properly.

Highlighted

[Phoenix] date column value does not compare properly.

Contributor

Dear all.

 

Is there anyone who knows why below query return null?

 

0: jdbc:phoenix:lctsthb1502:2181> select count(operated) as cnt from user_history where operated between to_date('2015-02-24') and to_date('2015-02-24 00:10') ;
+------+
| CNT |
+------+
+------+

 

Actually the count is 21915.

I can show you the count as like below.

 

0: jdbc:phoenix:lctsthb1502:2181> select count(operated) as cnt from user_history where operated between to_date('2015-02-24 00:00:00.001') and to_date('2015-02-24 00:10') ;
+--------+
| CNT |
+--------+
| 21915 |
+--------+
1 row selected (0.197 seconds)

 

phoenix version is 4.7

 

Thanks in advance