protected int generateHashMapResultSingleValue(VectorizedRowBatch batch,
      VectorMapJoinHashMapResult hashMapResult, int[] allMatches, int allMatchesIndex,
      int duplicateCount, int numSel) throws HiveException, IOException {

    // Read single value.

    ByteSegmentRef byteSegmentRef = hashMapResult.first();

    // Generate result within big table batch itself.

    for (int i = 0; i < duplicateCount; i++) {

      final int batchIndex = allMatches[allMatchesIndex + i];

      if (outerSmallTableKeyVectorCopy != null) {

        // For [FULL] OUTER MapJoin, copy Big Table keys to Small Table area within
        // same batch by reference.
        //
        outerSmallTableKeyVectorCopy.copyByReference(
            batch, batchIndex,
            batch, batchIndex);
      }

      if (smallTableValueVectorDeserializeRow != null) {
        doSmallTableValueDeserializeRow(batch, batchIndex,
            byteSegmentRef, hashMapResult);
      }

      // Use the big table row as output.
      batch.selected[numSel++] = batchIndex;
    }

    return numSel;
  }
Generate join results for a single small table value match.

@param batch
         The big table batch.
@param hashMapResult
         The hash map results for the matching key.
@param allMatches
         The selection array for all matches key.
@param allMatchesIndex
         Index into allMatches of the matching key we are generating for.
@param duplicateCount
         Number of equal key rows.
@param numSel
         Current number of rows that are remaining in the big table for forwarding.
@return
         The new count of selected rows.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/mapjoin/VectorMapJoinGenerateResultOperator.java