deniskuzZ commented on code in PR #4319:
URL: https://github.com/apache/hive/pull/4319#discussion_r1198653649


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -7040,13 +7041,12 @@ private boolean updatePartitonColStatsInternal(Table 
tbl, ColumnStatistics colSt
     List<String> partVals;
     boolean committed = false;
     getMS().openTransaction();
-
+    
     try {
-      if (tbl == null) {
-        tbl = getTable(catName, dbName, tableName);
-      }
+      tbl = Optional.ofNullable(tbl).orElse(getTable(catName, dbName, 
tableName));
       partVals = getPartValsFromName(tbl, csd.getPartName());
-      parameters = getMS().updatePartitionColumnStatistics(colStats, partVals, 
validWriteIds, writeId);
+      parameters = mTable == null ? 
getMS().updatePartitionColumnStatistics(colStats, partVals, validWriteIds, 
writeId) : 

Review Comment:
   To avoid this if-else logic, what if we do for mTable the same as for tbl?
   ````
   mTable = Optional.ofNullable(mTable).orElse(getMS().ensureGetMTable(catName, 
dbName, tblName);
   parameters  = getMS().updatePartitionColumnStatistics(tbl, mTable, colStats, 
partVals, validWriteIds, writeId);
   ````



-- 
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.

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to