private void setupSpillSerDe(VectorizedRowBatch batch) throws HiveException {

    TypeInfo[] inputObjInspectorsTypeInfos =
        VectorizedBatchUtil.typeInfosFromStructObjectInspector(
               (StructObjectInspector) inputObjInspectors[posBigTable]);

    List<Integer> projectedColumns = vContext.getProjectedColumns();
    int projectionSize = vContext.getProjectedColumns().size();

    List<TypeInfo> typeInfoList = new ArrayList<TypeInfo>();
    List<Integer> noNullsProjectionList = new ArrayList<Integer>();
    for (int i = 0; i < projectionSize; i++) {
      int projectedColumn = projectedColumns.get(i);
      if (batch.cols[projectedColumn] != null &&
          inputObjInspectorsTypeInfos[i].getCategory() == Category.PRIMITIVE) {
        // Only columns present in the batch and non-complex types.
        typeInfoList.add(inputObjInspectorsTypeInfos[i]);
        noNullsProjectionList.add(projectedColumn);
      }
    }

    int[] noNullsProjection = ArrayUtils.toPrimitive(noNullsProjectionList.toArray(new Integer[0]));
    int noNullsProjectionSize = noNullsProjection.length;
    bigTableTypeInfos = typeInfoList.toArray(new TypeInfo[0]);

    bigTableVectorSerializeRow =
            new VectorSerializeRow<LazyBinarySerializeWrite>(
                new LazyBinarySerializeWrite(noNullsProjectionSize));

    bigTableVectorSerializeRow.init(
                bigTableTypeInfos,
                noNullsProjection);

    bigTableVectorDeserializeRow =
        new VectorDeserializeRow<LazyBinaryDeserializeRead>(
            new LazyBinaryDeserializeRead(
                bigTableTypeInfos,
                /* useExternalBuffer */ true));

    bigTableVectorDeserializeRow.init(noNullsProjection);
  }
Generate optimized results when entire batch key is repeated and it matched the hash map.

@param batch
         The big table batch.
@param hashMapResult
         The hash map results for the repeated key.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/mapjoin/VectorMapJoinGenerateResultOperator.java