private void generateHashMultiSetResultMultiValue(VectorizedRowBatch batch,
      int[] allMatches, int allMatchesIndex,
      int duplicateCount, long count) throws HiveException, IOException {

    // LOG.debug("generateHashMultiSetResultMultiValue allMatchesIndex " + allMatchesIndex + " duplicateCount " + duplicateCount + " count " + count);

    // TODO: Look at repeating optimizations...

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

      int batchIndex = allMatches[allMatchesIndex + i];

      for (long l = 0; l < count; l++) {

        // Copy the values into the overflow batch. Since the overflow batch may
        // not get flushed here, we must copy by value.
        if (bigTableRetainedVectorCopy != null) {
          bigTableRetainedVectorCopy.copyByValue(batch, batchIndex,
                                                 overflowBatch, overflowBatch.size);
        }
        if (nonOuterSmallTableKeyVectorCopy != null) {
          nonOuterSmallTableKeyVectorCopy.copyByValue(batch, batchIndex,
              overflowBatch, overflowBatch.size);
        }

        overflowBatch.size++;
        if (overflowBatch.size == overflowBatch.DEFAULT_SIZE) {
          forwardOverflow();
        }
      }
    }
  }
Generate results for a N x M cross product.

@param batch
         The big table batch.
@param allMatches
         The all match selected array that contains (physical) batch indices.
@param allMatchesIndex
         The index of the match key.
@param duplicateCount
         Number of equal key rows.
@param count
         Value count.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/mapjoin/VectorMapJoinInnerBigOnlyGenerateResultOperator.java