public VectorizedRowBatch createVectorizedRowBatch()
  {
    final int nonScratchColumnCount = rowColumnTypeInfos.length;
    final int totalColumnCount =
        nonScratchColumnCount + scratchColumnTypeNames.length;
    VectorizedRowBatch result = new VectorizedRowBatch(totalColumnCount);

    if (dataColumnNums == null) {
        // All data and partition columns.
      for (int i = 0; i < nonScratchColumnCount; i++) {
        result.cols[i] = createColumnVectorFromRowColumnTypeInfos(i);
      }
    } else {
      // Create only needed/included columns data columns.
      for (int i = 0; i < dataColumnNums.length; i++) {
        int columnNum = dataColumnNums[i];
        Preconditions.checkState(columnNum < nonScratchColumnCount);
        result.cols[columnNum] =
            createColumnVectorFromRowColumnTypeInfos(columnNum);
      }
      // Always create partition and virtual columns.
      final int partitionEndColumnNum = dataColumnCount + partitionColumnCount;
      for (int partitionColumnNum = dataColumnCount; partitionColumnNum < partitionEndColumnNum; partitionColumnNum++) {
        result.cols[partitionColumnNum] =
          createColumnVectorFromRowColumnTypeInfos(partitionColumnNum);
      }
      final int virtualEndColumnNum = partitionEndColumnNum + virtualColumnCount;
      for (int virtualColumnNum = partitionEndColumnNum; virtualColumnNum < virtualEndColumnNum; virtualColumnNum++) {
        String virtualColumnName = rowColumnNames[virtualColumnNum];
        if (!isVirtualColumnNeeded(virtualColumnName)) {
          continue;
        }
        result.cols[virtualColumnNum] =
            VectorizedBatchUtil.createColumnVector(rowColumnTypeInfos[virtualColumnNum]);
      }
    }

    for (int i = 0; i < scratchColumnTypeNames.length; i++) {
      String typeName = scratchColumnTypeNames[i];
      DataTypePhysicalVariation dataTypePhysicalVariation = scratchDataTypePhysicalVariations[i];
      result.cols[nonScratchColumnCount + i] =
          VectorizedBatchUtil.createColumnVector(typeName, dataTypePhysicalVariation);
    }

    // UNDONE: Also remember virtualColumnCount...
    result.setPartitionInfo(dataColumnCount, partitionColumnCount);

    result.reset();
    return result;
  }
Creates a Vectorized row batch and the column vectors.

@return VectorizedRowBatch
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedRowBatchCtx.java