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

Incorrect aggregate query results when stats are disable for parallelization

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.12.0
    • 4.13.0
    • None
    • HBase 1.3.1

    Description

      With phoenix.use.stats.parallelization set to false, aggregate query returns incorrect results when stats are available.

      With local index and stats disabled for parallelization:

      explain select count(*) from TABLE_T;
      +-------------------------------------------------------------------------------------------------------+-----------------+----------------+-----------+
      |                                                 PLAN                                                  | EST_BYTES_READ  | EST_ROWS_READ  |  EST_INFO |
      +-------------------------------------------------------------------------------------------------------+-----------------+----------------+-----------+
      | CLIENT 0-CHUNK 332170 ROWS 625043899 BYTES PARALLEL 0-WAY RANGE SCAN OVER TABLE_T [1]  | 625043899       | 332170         | 150792825 |
      |     SERVER FILTER BY FIRST KEY ONLY                                                                   | 625043899       | 332170         | 150792825 |
      |     SERVER AGGREGATE INTO SINGLE ROW                                                                  | 625043899       | 332170         | 150792825 |
      +-------------------------------------------------------------------------------------------------------+-----------------+----------------+-----------+
      
      select count(*) from TABLE_T;
      +-----------+
      | COUNT(1)  |
      +-----------+
      | 0         |
      +-----------+
      

      Using data table

      explain select /*+NO_INDEX*/ count(*) from TABLE_T;
      +--------------------------------------------------------------------------------------------------+-----------------+----------------+----------------+
      |                                               PLAN                                               | EST_BYTES_READ  | EST_ROWS_READ  |  EST_INFO_TS   |
      +--------------------------------------------------------------------------------------------------+-----------------+----------------+----------------+
      | CLIENT 2-CHUNK 332151 ROWS 438492470 BYTES PARALLEL 1-WAY FULL SCAN OVER TABLE_T  | 438492470       | 332151         | 1507928257617  |
      |     SERVER FILTER BY FIRST KEY ONLY                                                              | 438492470       | 332151         | 1507928257617  |
      |     SERVER AGGREGATE INTO SINGLE ROW                                                             | 438492470       | 332151         | 1507928257617  |
      +--------------------------------------------------------------------------------------------------+-----------------+----------------+----------------+
      
      select /*+NO_INDEX*/ count(*) from TABLE_T;
      +-----------+
      | COUNT(1)  |
      +-----------+
      | 14        |
      +-----------+
      

      Without stats available, results are correct:

      explain select /*+NO_INDEX*/ count(*) from TABLE_T;
      +----------------------------------------------------------------------+-----------------+----------------+--------------+
      |                                 PLAN                                 | EST_BYTES_READ  | EST_ROWS_READ  | EST_INFO_TS  |
      +----------------------------------------------------------------------+-----------------+----------------+--------------+
      | CLIENT 2-CHUNK PARALLEL 1-WAY FULL SCAN OVER TABLE_T  | null            | null           | null         |
      |     SERVER FILTER BY FIRST KEY ONLY                                  | null            | null           | null         |
      |     SERVER AGGREGATE INTO SINGLE ROW                                 | null            | null           | null         |
      +----------------------------------------------------------------------+-----------------+----------------+--------------+
      select /*+NO_INDEX*/ count(*) from TABLE_T;
      +-----------+
      | COUNT(1)  |
      +-----------+
      | 333327    |
      +-----------+
      

      Attachments

        1. PHOENIX-4287_addendum.patch
          6 kB
          Samarth Jain
        2. PHOENIX-4287_addendum2.patch
          14 kB
          Samarth Jain
        3. PHOENIX-4287_addendum3.patch
          23 kB
          Samarth Jain
        4. PHOENIX-4287_addendum4.patch
          26 kB
          Samarth Jain
        5. PHOENIX-4287_addendum5.patch
          15 kB
          Samarth Jain
        6. PHOENIX-4287_addendum6.patch
          16 kB
          Samarth Jain
        7. PHOENIX-4287_addendum7.patch
          0.9 kB
          Samarth Jain
        8. PHOENIX-4287_v2.patch
          23 kB
          Samarth Jain
        9. PHOENIX-4287_v3_wip.patch
          19 kB
          Samarth Jain
        10. PHOENIX-4287_v3.patch
          19 kB
          Samarth Jain
        11. PHOENIX-4287_v4.patch
          20 kB
          Samarth Jain
        12. PHOENIX-4287.patch
          40 kB
          Samarth Jain

        Activity

          People

            samarthjain Samarth Jain
            mujtabachohan Mujtaba Chohan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: