dengzhhu653 commented on code in PR #6198:
URL: https://github.com/apache/hive/pull/6198#discussion_r2766758003


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -10111,6 +10129,19 @@ private boolean 
deleteTableColumnStatisticsViaJdo(String catName, String dbName,
         throw new NoSuchObjectException("Column stats doesn't exist for db=" + 
dbName + " table="
             + tableName + " col=" + String.join(", ", colNames));
       }
+      if (mStatsObjColl != null) {
+        pm.deletePersistentAll(mStatsObjColl);
+        // Update COLUMN_STATS_ACCURATE to reflect the deletion
+        Table tbl = getTable(catName, dbName, tableName);
+        // Initialize the directSql again in case it became null in-between
+        String schema = 
PersistenceManagerProvider.getProperty("javax.jdo.mapping.Schema");
+        schema = org.apache.commons.lang3.StringUtils.defaultIfBlank(schema, 
null);
+        directSql = new MetaStoreDirectSql(pm, conf, schema); // Use the 
original colNames (can be null or empty)
+        directSql.updateColumnStatsAccurateForTable(tbl, colNames);

Review Comment:
   use `ObjectStore.alterTable` in the jdo path?



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