Class RowKeyComparisonRunLengths


  • public class RowKeyComparisonRunLengths
    extends Object
    Denotes the ascending-descending run lengths of the fields of the keycolumns that can be compared together. It analyses the key columns and their types. It coalesces the adjacent key columns if they are: a. Byte comparable, i.e. the fields won't need to be deserialized before comparing. It doesn't care about the types b. Have same order All the primitive and the primitive arrays are byte comparable. The complex types are not byte comparable, and nested arrays and arrays of complex objects are not supported by MSQ right now. Consider a row with the key columns like: ColumnName ColumnType Order ========================================== longAsc1 LONG ASC stringAsc1 STRING ASC stringDesc1 STRING DESC longDesc1 LONG DESC complexDesc1 COMPLEX DESC complexAsc1 COMPLEX ASC complexAsc2 COMPLEX ASC stringAsc2 STRING ASC The run lengths generated would be: RunLengthEntry Run length Order Is byte comparable Explanation ==================================================================================================================== RunLengthEntry#1 2 ASC true Even though longAsc1 and stringAsc1 had different types, both types are byte comparable and have same direction. Therefore, they can be byte-compared together RunLengthEntry#2 2 DESC true stringDesc1 can't be clubed with the previous stringAsc1 due to different ordering. It is clubbed with the following longDesc1 due to the reason stated above RunLengthEntry#3 1 DESC false Non byte comparable types cannot be clubbed with anything RunLengthEntry#4 1 ASC false Non byte comparable types cannot be clubbed with anything RunLengthEntry#5 1 ASC false Non byte comparable types cannot be clubbed with anything despite the previous key column having same order and the type RunLengthEntry#6 1 ASC true Cannot be clubbed with previous entry. It is own entry