private void lockNotificationSequenceForUpdate() throws MetaException {
    if (sqlGenerator.getDbProduct().isDERBY() && directSql != null) {
      // Derby doesn't allow FOR UPDATE to lock the row being selected (See https://db.apache
      // .org/derby/docs/10.1/ref/rrefsqlj31783.html) . So lock the whole table. Since there's
      // only one row in the table, this shouldn't cause any performance degradation.
      new RetryingExecutor(conf, () -> {
        directSql.lockDbTable("NOTIFICATION_SEQUENCE");
      }).run();
    } else {
      String selectQuery = "select \"NEXT_EVENT_ID\" from \"NOTIFICATION_SEQUENCE\"";
      String lockingQuery = sqlGenerator.addForUpdateClause(selectQuery);
      new RetryingExecutor(conf, () -> {
        prepareQuotes();
        try (QueryWrapper query = new QueryWrapper(pm.newQuery("javax.jdo.query.SQL", lockingQuery))) {
          query.setUnique(true);
          // only need to execute it to get db Lock
          query.execute();
        }
      }).run();
    }
  }
Get partition's column stats

@return Map of column name and its stats
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java