private List<org.apache.hadoop.hive.ql.metadata.Partition> addPartitionsNoReplication(Table table,
      List<Partition> partitions) throws HiveException {
    // TODO: normally, the result is not necessary; might make sense to pass false
    List<org.apache.hadoop.hive.ql.metadata.Partition> outPartitions = new ArrayList<>();
    for (Partition outPart : context.getDb().addPartitions(partitions, desc.isIfNotExists(), true)) {
      outPartitions.add(new org.apache.hadoop.hive.ql.metadata.Partition(table, outPart));
    }
    return outPartitions;
  }
Operation process of adding a partition to a table.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/add/AlterTableAddPartitionOperation.java