[ 
https://issues.apache.org/jira/browse/HIVE-25225?focusedWorklogId=609384&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609384
 ]

ASF GitHub Bot logged work on HIVE-25225:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Jun/21 21:00
            Start Date: 09/Jun/21 21:00
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #2376:
URL: https://github.com/apache/hive/pull/2376#discussion_r648681379



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -7006,16 +7006,40 @@ private boolean updatePartitonColStatsInternal(Table 
tbl, ColumnStatistics colSt
         + " part=" + csd.getPartName());
 
     boolean ret = false;
+
+    Map<String, String> parameters;
+    List<String> partVals;
+    boolean committed = false;
+    getMS().openTransaction();
+
     try {
       if (tbl == null) {
         tbl = getTable(catName, dbName, tableName);
       }
-      ret = updatePartitionColStatsInBatch(tbl, 
Collections.singletonMap(csd.getPartName(), colStats),
-              validWriteIds, writeId);
+      partVals = getPartValsFromName(tbl, csd.getPartName());
+      parameters = getMS().updatePartitionColumnStatistics(colStats, partVals, 
validWriteIds, writeId);
+      if (parameters != null) {
+        if (transactionalListeners != null && 
!transactionalListeners.isEmpty()) {
+          MetaStoreListenerNotifier.notifyEvent(transactionalListeners,
+                  EventType.UPDATE_PARTITION_COLUMN_STAT,
+                  new UpdatePartitionColumnStatEvent(colStats, partVals, 
parameters, tbl,
+                          writeId, this));
+        }
+        if (!listeners.isEmpty()) {

Review comment:
       We usually put the non-transactional listeners after the 
`commitTransaction` so if there is an error there then it will not roll back 
the changes done in the transaction




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 609384)
    Time Spent: 20m  (was: 10m)

> Update column stat throws NPE if direct sql is disabled
> -------------------------------------------------------
>
>                 Key: HIVE-25225
>                 URL: https://issues.apache.org/jira/browse/HIVE-25225
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: mahesh kumar behera
>            Assignee: mahesh kumar behera
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> In case direct sql is disabled, the MetaStoreDirectSql object is not 
> initialised and thats causing NPE. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to