LogicalInput input = tezContext.getInput(inputName);
try {
KeyValueReader kvReader = (KeyValueReader) input.getReader();
MapJoinTableContainer tableContainer = new HashMapWrapper(hashTableThreshold,
hashTableLoadFactor);
// simply read all the kv pairs into the hashtable.
while (kvReader.next()) {
// We pass key in as reference, to find out quickly if optimized keys can be used.
// However, we do not reuse the object since we are putting them into the hashmap.
lastKey = MapJoinKey.read(output, lastKey, mapJoinTableSerdes[pos].getKeyContext(),
(Writable)kvReader.getCurrentKey(), false);
LazyFlatRowContainer values = (LazyFlatRowContainer)tableContainer.get(lastKey);
if (values == null) {
values = new LazyFlatRowContainer();
tableContainer.put(lastKey, values);
}
values.add(mapJoinTableSerdes[pos].getValueContext(),
(BytesWritable)kvReader.getCurrentValue(), useLazyRows);
}