diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java index 2b401ac..eac35cb 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorHashKeyWrapperBatch.java @@ -106,132 +106,150 @@ public void evaluateBatch(VectorizedRowBatch batch) throws HiveException { keyIndex = longIndices[i]; columnIndex = keyExpressions[keyIndex].getOutputColumnNum(); LongColumnVector columnVector = (LongColumnVector) batch.cols[columnIndex]; - if (columnVector.noNulls && !columnVector.isRepeating && !batch.selectedInUse) { - assignLongNoNullsNoRepeatingNoSelection(i, batch.size, columnVector); - } else if (columnVector.noNulls && !columnVector.isRepeating && batch.selectedInUse) { - assignLongNoNullsNoRepeatingSelection(i, batch.size, columnVector, batch.selected); - } else if ((columnVector.noNulls || !columnVector.isNull[0]) && columnVector.isRepeating) { - assignLongNoNullsRepeating(i, batch.size, columnVector); - } else if (!columnVector.noNulls && !columnVector.isRepeating && !batch.selectedInUse) { - assignLongNullsNoRepeatingNoSelection(keyIndex, i, batch.size, columnVector); - } else if (!columnVector.noNulls && columnVector.isRepeating) { - assignLongNullsRepeating(keyIndex, i, batch.size, columnVector); - } else if (!columnVector.noNulls && !columnVector.isRepeating && batch.selectedInUse) { - assignLongNullsNoRepeatingSelection (keyIndex, i, batch.size, columnVector, batch.selected); + + if (columnVector.isRepeating) { + if (columnVector.noNulls || !columnVector.isNull[0]) { + assignLongNoNullsRepeating(i, batch.size, columnVector); + } else { + assignLongNullsRepeating(keyIndex, i, batch.size, columnVector); + } + } else if (columnVector.noNulls) { + if (batch.selectedInUse) { + assignLongNoNullsNoRepeatingSelection(i, batch.size, columnVector, batch.selected); + } else { + assignLongNoNullsNoRepeatingNoSelection(i, batch.size, columnVector); + } } else { - throw new HiveException (String.format( - "Unimplemented Long null/repeat/selected combination %b/%b/%b", - columnVector.noNulls, columnVector.isRepeating, batch.selectedInUse)); + if (batch.selectedInUse) { + assignLongNullsNoRepeatingSelection (keyIndex, i, batch.size, columnVector, batch.selected); + } else { + assignLongNullsNoRepeatingNoSelection(keyIndex, i, batch.size, columnVector); + } } } for(int i=0;i