Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-19935

Allow combining individual colocation hashes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-beta1
    • 3.0
    • None

    Description

      A hash of two columns currently is

      var coloHash = hash(col1, hash(col2, 0));
      

      which means we need to access the value of col1 after we compute the hash of col2. In other words, there is no way to calculate individual column hashes and combine them later.

      In practice this means we can't combine serialization and hashing when colocation column order is different from serialization order. As a result, we have to do the same work twice:
      1. Extract colocation column values (from tuple or POJO) and compute hash
      2. Extract all column values (from tuple or POJO) and serialize

      This is especially problematic for String, BigInteger and BitMask where we have to allocate an array and copy some bytes there.

      Solution
      Provide a way to combine hashes:

      var coloHash = hashCombine(hash(col2), hash(col1))
      

      This will allow computing individual column hashes and combining them later in any order.

      Attachments

        Issue Links

          Activity

            People

              ptupitsyn Pavel Tupitsyn
              ptupitsyn Pavel Tupitsyn
              Igor Sapego Igor Sapego
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m