Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2272

Unable to run count(1), count(*) or select explicit columns queries on a table with a secondary index

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 4.5.1
    • 4.14.0
    • None
    • HBase1.0, CDH5.4.5

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            kumarappan Kumar Palaniappan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: