You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2016/01/23 04:06:39 UTC
[jira] [Commented] (PHOENIX-2272) Unable to run count(1), count(*)
or select explicit columns queries on a table with a secondary index
[ https://issues.apache.org/jira/browse/PHOENIX-2272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15113519#comment-15113519 ]
James Taylor commented on PHOENIX-2272:
---------------------------------------
Is this still an issue, [~kumarappan]. Can you give us a way to repro it?
> Unable to run count(1), count(*) or select explicit columns queries on a table with a secondary index
> -----------------------------------------------------------------------------------------------------
>
> 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
> Fix For: 4.8.0
>
>
> 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)