private static Path getManifestDir(Path specPath, long writeId, int stmtId, String unionSuffix,
      boolean isInsertOverwrite, String staticSpec, boolean isDelete) {
    Path manifestRoot = specPath;
    if (staticSpec != null) {
      String tableRoot = specPath.toString();
      tableRoot = tableRoot.substring(0, tableRoot.length() - staticSpec.length());
      manifestRoot = new Path(tableRoot);
    }

    String deltaDir = AcidUtils.baseOrDeltaSubdir(isInsertOverwrite, writeId, writeId, stmtId);
    if (isDelete) {
      deltaDir = AcidUtils.deleteDeltaSubdir(writeId, writeId, stmtId);
    }
    Path manifestPath = new Path(manifestRoot, Utilities.toTempPath(deltaDir));

    if (isInsertOverwrite) {
      // When doing a multi-statement insert overwrite query with dynamic partitioning, the
      // generated manifest directory is the same for each FileSinkOperator.
      // To resolve this name collision, extending the manifest path with the statement id.
      manifestPath = new Path(manifestPath + "_" + stmtId);
    }

    return (unionSuffix == null) ? manifestPath : new Path(manifestPath, unionSuffix);
  }
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