Kumar Palaniappan created PHOENIX-2272:
------------------------------------------

             Summary: Unable to run count(1), count(*) or select explicit 
columns queries on a table with a secondary index table
                 Key: PHOENIX-2272
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2272
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.5.1
         Environment: HBase1.0, CDH5.4.5
            Reporter: Kumar Palaniappan


Unable to run select count(1) from table_name or select count(*) from 
table_name or select "id1" from table_name when there is a secondary index on a 
column in that table. It returns 0 records.

But select * from table_name works. 

select count(*) from r3.ads;
+------------------------------------------+
|                 COUNT(1)                 |
+------------------------------------------+
| 0                                        |
+------------------------------------------+
1 row selected (0.104 seconds)
0: jdbc:phoenix:labs-**********> select count(1) from r3.ads;
+------------------------------------------+
|                 COUNT(1)                 |
+------------------------------------------+
| 0                                        |
+------------------------------------------+

select count(distinct("cstId")) from r3.ads;
+------------------------------------------+
|         DISTINCT_COUNT("cstId")          |
+------------------------------------------+
| 0                                        |
+------------------------------------------+
1 row selected (0.114 seconds)

 jdbc:phoenix:labs-**********> select /*+ NO_INDEX */count(1) from r3.ads;
+------------------------------------------+
|                 COUNT(1)                 |
+------------------------------------------+
| 1617732                                  |
+------------------------------------------+
1 row selected (2.007 seconds)

If I force with a hint NO_INDEX works.

Is that related to somewhat this one? 
https://issues.apache.org/jira/browse/PHOENIX-1203



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to