Review Board 1.7.22


HIVE-4716 the VectorHashKeyWrapper is using a plain wrong column index for string values

Review Request #11857 - Created June 13, 2013 and submitted

Remus Rusanu
vectorization
HIVE-4716
Reviewers
hive
hanson5b, jitendra
hive-git
`stringIndices[i]= stringIndicesIndex` should be `stringIndices[stringIndicesIndex]= i`. D'oh!
the second issue fixed (wrong isNull index used in cloning) was uncovered in testing the fix
repro case tested
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapper.java
Revision 70e3cfd New Change
[20] 139 lines
[+20] [+] protected Object clone() {
140
    clone.byteValues = new byte[byteValues.length][];
140
    clone.byteValues = new byte[byteValues.length][];
141
    clone.byteStarts = new int[byteValues.length];
141
    clone.byteStarts = new int[byteValues.length];
142
    clone.byteLengths = byteLengths.clone();
142
    clone.byteLengths = byteLengths.clone();
143
    for (int i = 0; i < byteValues.length; ++i) {
143
    for (int i = 0; i < byteValues.length; ++i) {
144
      // avoid allocation/copy of nulls, because it potentially expensive. branch instead.
144
      // avoid allocation/copy of nulls, because it potentially expensive. branch instead.
145
      if (!isNull[i]) {
145
      if (!isNull[longValues.length + doubleValues.length + i]) {
146
        clone.byteValues[i] = Arrays.copyOfRange(
146
        clone.byteValues[i] = Arrays.copyOfRange(
147
            byteValues[i],
147
            byteValues[i],
148
            byteStarts[i],
148
            byteStarts[i],
149
            byteStarts[i] + byteLengths[i]);
149
            byteStarts[i] + byteLengths[i]);
150
      }
150
      }
[+20] [20] 98 lines
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java
Revision 669946d New Change
 
  1. ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapper.java: Loading...
  2. ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java: Loading...