* @param rowIndex the row index in the batch
* @param index the cachedKeys index to write to
*/
private void populateCachedDistinctKeys(
VectorizedRowBatch vrg, int rowIndex, int index) throws HiveException {
StandardUnion union;
cachedKeys[index][numDistributionKeys] = union = new StandardUnion(
(byte)index, new Object[distinctColIndices.get(index).size()]);
Object[] distinctParameters = (Object[]) union.getObject();
for (int distinctParamI = 0; distinctParamI < distinctParameters.length; distinctParamI++) {
int distinctColIndex = distinctColIndices.get(index).get(distinctParamI);
int batchColumn = keyEval[distinctColIndex].getOutputColumn();
distinctParameters[distinctParamI] =
keyWriters[distinctColIndex].writeValue(vrg.cols[batchColumn], rowIndex);
}
union.setTag((byte) index);
}