@Override
  public Partition getPartition(String catName, String dbName, String tableName,
                                List<String> part_vals,
                                String validWriteIds)
      throws NoSuchObjectException, MetaException {
    Partition part = null;
    boolean committed = false;
    try {
      openTransaction();
      MTable table = this.getMTable(catName, dbName, tableName);
      if (table == null) {
        throw new NoSuchObjectException("Unable to get partition because "
            + TableName.getQualified(catName, dbName, tableName) +
            " does not exist");
      }
      MPartition mpart = getMPartition(catName, dbName, tableName, part_vals, table);
      part = convertToPart(catName, dbName, tableName, mpart,
          TxnUtils.isAcidTable(table.getParameters()));
      committed = commitTransaction();
      if (part == null) {
        throw new NoSuchObjectException("partition values="
          + part_vals.toString());
      }

      part.setValues(part_vals);
      // If transactional table partition, check whether the current version partition
      // statistics in the metastore comply with the client query's snapshot isolation.
      long statsWriteId = mpart.getWriteId();
      if (TxnUtils.isTransactionalTable(table.getParameters())) {
        if (!areTxnStatsSupported) {
          // Do not make persistent the following state since it is query specific (not global).
          StatsSetupConst.setBasicStatsState(part.getParameters(), StatsSetupConst.FALSE);
          LOG.info("Removed COLUMN_STATS_ACCURATE from Partition object's parameters.");
        } else if (validWriteIds != null) {
          if (isCurrentStatsValidForTheQuery(part, statsWriteId, validWriteIds, false)) {
            part.setIsStatsCompliant(true);
          } else {
            part.setIsStatsCompliant(false);
            // Do not make persistent the following state since it is query specific (not global).
            StatsSetupConst.setBasicStatsState(part.getParameters(), StatsSetupConst.FALSE);
            LOG.info("Removed COLUMN_STATS_ACCURATE from Partition object's parameters.");
          }
        }
      }
    } finally {
      rollbackAndCleanup(committed, (Query)null);
    }
    return part;
  }
This method resets the stats to 0 and supports only backward compatibility with clients does not
send {@link SourceTable} instances.

Use {@link ObjectStore#convertToSourceTable(String, SourceTable)} instead.

@param catalog Catalog name where source table is located
@param fullyQualifiedTableName fully qualified name of source table
@return {@link MMVSource} instance represents this source table.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java