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
- blocks
-
IGNITE-19914 .NET: Thin 3.0: Colocation column order is not preserved
- Resolved
- is caused by
-
IGNITE-14769 Key hash calculation.
- Resolved
-
IGNITE-16594 Colocation key hash code calculation
- Resolved
- relates to
-
IGNITE-19970 Java thin 3.0: Combine hashing with serialization
- Open
- links to