public static void addTablePartsOutputs(Hive db, Set<WriteEntity> outputs, Table table,
      List<Map<String, String>> partitionSpecs, boolean allowMany, WriteEntity.WriteType writeType)
          throws SemanticException {
    for (Map<String, String> partitionSpec : partitionSpecs) {
      List<Partition> parts = null;
      if (allowMany) {
        try {
          parts = db.getPartitions(table, partitionSpec);
        } catch (HiveException e) {
          LOG.error("Got HiveException during obtaining list of partitions", e);
          throw new SemanticException(e.getMessage(), e);
        }
      } else {
        parts = new ArrayList<Partition>();
        try {
          Partition p = db.getPartition(table, partitionSpec, false);
          if (p != null) {
            parts.add(p);
          }
        } catch (HiveException e) {
          LOG.debug("Wrong specification", e);
          throw new SemanticException(e.getMessage(), e);
        }
      }
      for (Partition p : parts) {
        // Don't request any locks here, as the table has already been locked.
        outputs.add(new WriteEntity(p, writeType));
      }
    }
  }
Add the table partitions to be modified in the output, so that it is available for the pre-execution hook.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/PartitionUtils.java