hive-gitbox mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hive] aasha commented on a change in pull request #2235: HIVE-25072: Optimise ObjectStore::alterPartitions
Date Tue, 04 May 2021 04:01:03 GMT

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Mime
View raw message