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

Sort order incorrect for variable length DESC columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.4.0
    • 4.5.0
    • None
    • None
    • HBase 0.98.6-cdh5.3.0
      jdk1.7.0_67 x64
      CentOS release 6.4 (2.6.32-358.el6.x86_64)

    Description

      Steps to reproduce:
      1. Create a table:
      CREATE TABLE mytable (id BIGINT not null PRIMARY KEY, timestamp BIGINT, log_message varchar) IMMUTABLE_ROWS=true, SALT_BUCKETS=16;
      2. Create two indexes:
      CREATE INDEX mytable_index_search ON mytable(timestamp,id) INCLUDE (log_message) SALT_BUCKETS=16;
      CREATE INDEX mytable_index_search_desc ON mytable(timestamp DESC,id DESC) INCLUDE (log_message) SALT_BUCKETS=16;
      3. Upsert values:
      UPSERT INTO mytable VALUES(1, 1434983826018, 'message1');
      UPSERT INTO mytable VALUES(2, 1434983826100, 'message2');
      UPSERT INTO mytable VALUES(3, 1434983826101, 'message3');
      UPSERT INTO mytable VALUES(4, 1434983826202, 'message4');
      4. Sort DESC by timestamp:
      select timestamp,id,log_message from mytable ORDER BY timestamp DESC;

      Failure: data is sorted incorrectly. In case when we have two longs which are different only by last two digits (e.g. 1434983826155, 1434983826100) and one of the long ends with '00' we receive incorrect order.
      Sorting result:
      1434983826202
      1434983826100
      1434983826101
      1434983826018

      Attachments

        1. PHOENIX-2067_v1.patch
          261 kB
          James R. Taylor
        2. PHOENIX-2067_v2.patch
          259 kB
          James R. Taylor
        3. PHOENIX-2067_v3.patch
          262 kB
          James R. Taylor
        4. PHOENIX-2067_array_addendum.patch
          11 kB
          James R. Taylor
        5. PHOENIX-2067_array_addendum_v2.patch
          290 kB
          James R. Taylor
        6. PHOENIX-2067_addendum.patch
          2 kB
          James R. Taylor
        7. PHOENIX-2067-tests.patch
          24 kB
          Dumindu Buddhika
        8. PHOENIX-2067-tests2.patch
          28 kB
          Dumindu Buddhika
        9. PHOENIX-2067_4.4.1.patch
          532 kB
          Rajeshbabu Chintaguntla

        Issue Links

          Activity

            People

              jamestaylor James R. Taylor
              mykola.komarnytskyy Mykola Komarnytskyy
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: