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

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

                Author: ASF GitHub Bot
            Created on: 21/May/21 03:39
            Start Date: 21/May/21 03:39
    Worklog Time Spent: 10m 
      Work Description: maheshk114 commented on a change in pull request #2266:
URL: https://github.com/apache/hive/pull/2266#discussion_r636613441



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -8994,10 +9028,15 @@ public boolean 
set_aggr_stats_for(SetPartitionsStatsRequest request) throws TExc
             colNames, newStatsMap, request);
       } else { // No merge.
         Table t = getTable(catName, dbName, tableName);
-        for (Map.Entry<String, ColumnStatistics> entry : 
newStatsMap.entrySet()) {
-          // We don't short-circuit on errors here anymore. That can leave 
acid stats invalid.
-          ret = updatePartitonColStatsInternal(t, entry.getValue(),
-              request.getValidWriteIdList(), request.getWriteId()) && ret;
+        // We don't short-circuit on errors here anymore. That can leave acid 
stats invalid.
+        if (newStatsMap.size() > 1) {
+          LOG.info("ETL_PERF started updatePartitionColStatsInBatch");
+          ret = updatePartitionColStatsInBatch(t, newStatsMap,
+                  request.getValidWriteIdList(), request.getWriteId());
+          LOG.info("ETL_PERF done updatePartitionColStatsInBatch");
+        } else {
+          ret = updatePartitonColStatsInternal(t, 
newStatsMap.values().iterator().next(),

Review comment:
       The batching is a specific condition, when the partitions are from same 
table. I am not sure if in other flows this holds good. So i have used the 
batching only in the flow where this is guaranteed. 




-- 
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 600161)
    Time Spent: 50m  (was: 40m)

> Batch process in ColStatsProcessor for partitions.
> --------------------------------------------------
>
>                 Key: HIVE-24663
>                 URL: https://issues.apache.org/jira/browse/HIVE-24663
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Rajesh Balamohan
>            Assignee: mahesh kumar behera
>            Priority: Major
>              Labels: performance, pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> When large number of partitions (>20K) are processed, ColStatsProcessor runs 
> into DB issues. 
> {{ db.setPartitionColumnStatistics(request);}} gets stuck for hours together 
> and in some cases postgres stops processing. 
> It would be good to introduce small batches for stats gathering in 
> ColStatsProcessor instead of bulk update.
> Ref: 
> https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/stats/ColStatsProcessor.java#L181
> https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/stats/ColStatsProcessor.java#L199



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

Reply via email to