Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-15741

Faster unsafe byte array comparisons

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Byte array comparison is heavily used in joins and string conditions. Pure Java implementation is simple but not performant. An implementation with Unsafe#getLong is much faster. It's already implemented in org.apache.hadoop.io.WritableComparator#compare. The WritableComparator class handles exceptional cases, including a different endian and no access to Unsafe, and it was used for many years in production.

      This patch will replace pure Java byte array comparisons with safe and faster unsafe ones to get more performance.

      Attachments

        1. HIVE-15741.4.patch
          11 kB
          Teddy Choi
        2. HIVE-15741.3.patch
          11 kB
          Teddy Choi
        3. HIVE-15741.2.patch
          11 kB
          Teddy Choi
        4. HIVE-15741.1.patch
          11 kB
          Teddy Choi

        Issue Links

          Activity

            People

              teddy.choi Teddy Choi
              teddy.choi Teddy Choi
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: