public Map<String, Map<String, String>> updatePartitionColumnStatistics(Map<String, ColumnStatistics> partColStatsMap,
                                                      Table tbl, long csId,
                                                      String validWriteIds, long writeId,
                                                      List<TransactionalMetaStoreEventListener> transactionalListeners)
          throws MetaException {

    Transaction tx = pm.currentTransaction();
    try {
      dbType.lockInternal();
      tx.begin();
      JDOConnection jdoConn = null;
      Map<String, Map<String, String>> result;
      try {
        jdoConn = pm.getDataStoreConnection();
        Connection dbConn = (Connection) jdoConn.getNativeConnection();
        setAnsiQuotes(dbConn);

        Map<PartitionInfo, ColumnStatistics> partitionInfoMap = getPartitionInfo(dbConn, tbl.getId(), partColStatsMap);

        result = updatePartitionParamTable(dbConn, partitionInfoMap, validWriteIds,
            writeId, TxnUtils.isAcidTable(tbl));

        Map<PartColNameInfo, MPartitionColumnStatistics> insertMap = new HashMap<>();
        Map<PartColNameInfo, MPartitionColumnStatistics> updateMap = new HashMap<>();
        populateInsertUpdateMap(partitionInfoMap, updateMap, insertMap, dbConn, tbl);

        LOG.info("Number of stats to insert  " + insertMap.size() + " update " + updateMap.size());

        if (insertMap.size() != 0) {
          insertIntoPartColStatTable(insertMap, csId, dbConn);
        }

        if (updateMap.size() != 0) {
          updatePartColStatTable(updateMap, dbConn);
        }

        if (transactionalListeners != null) {
          UpdatePartitionColumnStatEventBatch eventBatch = new UpdatePartitionColumnStatEventBatch(null);
          for (Map.Entry entry : result.entrySet()) {
            Map<String, String> parameters = (Map<String, String>) entry.getValue();
            ColumnStatistics colStats = partColStatsMap.get(entry.getKey());
            List<String> partVals = getPartValsFromName(tbl, colStats.getStatsDesc().getPartName());
            UpdatePartitionColumnStatEvent event = new UpdatePartitionColumnStatEvent(colStats, partVals, parameters,
                tbl, writeId, null);
            eventBatch.addPartColStatEvent(event);
          }
          MetaStoreListenerNotifier.notifyEventWithDirectSql(transactionalListeners,
              EventMessage.EventType.UPDATE_PARTITION_COLUMN_STAT_BATCH, eventBatch, dbConn, sqlGenerator);
        }
      } finally {
        closeDbConn(jdoConn);
      }
      tx.commit();
      return result;
    } catch (Exception e) {
      LOG.error("Unable to update Column stats for  " + tbl.getTableName(), e);
      throw new MetaException("Unable to update Column stats for  " + tbl.getTableName()
              + " due to: "  + e.getMessage());
    } finally {
      if (tx.isActive()) {
        tx.rollback();
      }
      dbType.unlockInternal();
    }
  }
Update the statistics for the given partitions. Add the notification logs also.
@return map of partition key to column stats if successful, null otherwise.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DirectSqlUpdatePart.java