[ https://issues.apache.org/jira/browse/HIVE-25072?focusedWorklogId=592552&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-592552 ]
ASF GitHub Bot logged work on HIVE-25072: ----------------------------------------- Author: ASF GitHub Bot Created on: 04/May/21 04:01 Start Date: 04/May/21 04:01 Worklog Time Spent: 10m Work Description: aasha commented on a change in pull request #2235: URL: https://github.com/apache/hive/pull/2235#discussion_r625495710 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java ########## @@ -5095,14 +5095,18 @@ public Partition alterPartition(String catName, String dbname, String name, List Iterator<List<String>> part_val_itr = part_vals.iterator(); Set<MColumnDescriptor> oldCds = new HashSet<>(); Ref<MColumnDescriptor> oldCdRef = new Ref<>(); + MTable table = null; for (Partition tmpPart: newParts) { List<String> tmpPartVals = part_val_itr.next(); if (writeId > 0) { tmpPart.setWriteId(writeId); } oldCdRef.t = null; + if (table == null) { + table = this.getMTable(tmpPart.getCatName(), tmpPart.getDbName(), tmpPart.getTableName()); + } Partition result = alterPartitionNoTxn( - catName, dbname, name, tmpPartVals, tmpPart, queryWriteIdList, oldCdRef); Review comment: Do we need the alterPartitionNoTxn with the following signature anymore private Partition alterPartitionNoTxn(String catName, String dbname, String name, List<String> part_vals, Partition newPart, String validWriteIds, Ref<MColumnDescriptor> oldCd) Even single alter partition can use the same call with the table already passed. Will not result to any improvement but just a clean up of the code. -- 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: 592552) Time Spent: 20m (was: 10m) > Optimise ObjectStore::alterPartitions > ------------------------------------- > > Key: HIVE-25072 > URL: https://issues.apache.org/jira/browse/HIVE-25072 > Project: Hive > Issue Type: Improvement > Components: Metastore > Reporter: Rajesh Balamohan > Priority: Major > Labels: pull-request-available > Time Spent: 20m > Remaining Estimate: 0h > > Avoid fetching table details for every partition in the table. > Ref: > > https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L5104 > https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L4986 -- This message was sent by Atlassian Jira (v8.3.4#803005)