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


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java:
##########
@@ -226,16 +229,21 @@ private static ColumnStatistics 
updateStatsForAlterPart(RawStore rawStore, Table
   private static void updateStatsForAlterTable(RawStore rawStore, Table 
tblBefore, Table tblAfter, String catalogName,
       String dbName, String tableName) throws Exception {
     ColumnStatistics colStats = null;
-    List<String> deletedCols = new ArrayList<>();
     if (tblBefore.isSetPartitionKeys()) {
       List<Partition> parts = sharedCache.listCachedPartitions(catalogName, 
dbName, tableName, -1);
       for (Partition part : parts) {
         colStats = updateStatsForAlterPart(rawStore, tblBefore, catalogName, 
dbName, tableName, part);
       }
     }
 
-    List<ColumnStatistics> multiColumnStats = HiveAlterHandler
-        .alterTableUpdateTableColumnStats(rawStore, tblBefore, tblAfter, null, 
null, rawStore.getConf(), deletedCols);
+    rawStore.alterTable(catalogName, dbName, tblBefore.getTableName(), 
tblAfter, null);
+
+    Set<String> deletedCols = new HashSet<>();
+    List<ColumnStatistics> multiColumnStats = 
HiveAlterHandler.getColumnStats(rawStore, tblBefore);
+    multiColumnStats.forEach(cs ->
+      
deletedCols.addAll(HiveAlterHandler.filterColumnStatsForTableColumns(tblBefore.getSd().getCols(),
 cs)

Review Comment:
   can we simply assign the result to deletedCols? btw, was this logic 
partially extracted from alterTableUpdateTableColumnStats?



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