public static void writeCommitManifest(List<Path> commitPaths, Path specPath, FileSystem fs,
      String taskId, Long writeId, int stmtId, String unionSuffix, boolean isInsertOverwrite,
      boolean hasDynamicPartitions, Set<String> dynamicPartitionSpecs, String staticSpec, boolean isDelete) throws HiveException {

    // When doing a multi-statement insert overwrite with dynamic partitioning,
    // the partition information will be written to the manifest file.
    // This is needed because in this use case each FileSinkOperator should clean-up
    // only the partition directories written by the same FileSinkOperator and do not
    // clean-up the partition directories written by the other FileSinkOperators.
    // If a statement from the insert overwrite query, doesn't produce any data,
    // a manifest file will still be written, otherwise the missing manifest file
    // would result a clean-up on table level which could delete the data written by
    // the other FileSinkOperators. (For further details please see HIVE-23114.)
    boolean writeDynamicPartitionsToManifest = hasDynamicPartitions;
    if (commitPaths.isEmpty() && !writeDynamicPartitionsToManifest) {
      return;
    }

    // We assume one FSOP per task (per specPath), so we create it in specPath.
    Path manifestPath = getManifestDir(specPath, writeId, stmtId, unionSuffix, isInsertOverwrite, staticSpec, isDelete);
    manifestPath = new Path(manifestPath, taskId + MANIFEST_EXTENSION);
    Utilities.FILE_OP_LOGGER.info("Writing manifest to {} with {}", manifestPath, commitPaths);
    try {
      // Don't overwrite the manifest... should fail if we have collisions.
      try (FSDataOutputStream out = fs.create(manifestPath, false)) {
        if (out == null) {
          throw new HiveException("Failed to create manifest at " + manifestPath);
        }

        if (writeDynamicPartitionsToManifest) {
          out.writeInt(dynamicPartitionSpecs.size());
          for (String dynamicPartitionSpec : dynamicPartitionSpecs) {
            out.writeUTF(dynamicPartitionSpec.toString());
          }
        }

        out.writeInt(commitPaths.size());
        for (Path path : commitPaths) {
          out.writeUTF(path.toString());
        }
      }
    } catch (IOException e) {
      throw new HiveException(e);
    }
  }
Create row key and value object inspectors for reduce vectorization.
The row object inspector used by ReduceWork needs to be a **standard**
struct object inspector, not just any struct object inspector.
@param keyInspector
@param valueInspector
@return OI
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java