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

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

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



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -7040,6 +7040,40 @@ private boolean updatePartitonColStatsInternal(Table 
tbl, ColumnStatistics colSt
     return parameters != null;
   }
 
+  private boolean updatePartitionColStatsInBatch(Table tbl, Map<String, 
ColumnStatistics> statsMap,
+                                                 String validWriteIds, long 
writeId)
+          throws MetaException, InvalidObjectException, NoSuchObjectException, 
InvalidInputException {
+
+    if (statsMap.size() == 0) {
+      return false;
+    }
+
+    String catalogName = tbl.getCatName();
+    String dbName = tbl.getDbName();
+    String tableName = tbl.getTableName();
+
+    startFunction("updatePartitionColStatsInBatch", ":  db=" + dbName  + " 
table=" + tableName);
+
+    Map<String, ColumnStatistics> newStatsMap = new HashMap<>();
+    for (Map.Entry entry : statsMap.entrySet()) {
+      ColumnStatistics colStats = (ColumnStatistics) entry.getValue();
+      normalizeColStatsInput(colStats);
+      assert 
catalogName.equalsIgnoreCase(colStats.getStatsDesc().getCatName());
+      assert dbName.equalsIgnoreCase(colStats.getStatsDesc().getDbName());
+      assert 
tableName.equalsIgnoreCase(colStats.getStatsDesc().getTableName());
+      newStatsMap.put((String) entry.getKey(), colStats);
+    }
+
+    boolean ret = false;
+    try {
+      ret = getTxnHandler().updatePartitionColumnStatistics(newStatsMap, this,

Review comment:
       done




-- 
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: 604082)
    Time Spent: 6h 40m  (was: 6.5h)

> 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: 6h 40m
>  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