geyanggang commented on code in PR #13021:
URL: https://github.com/apache/gravitino/pull/13021#discussion_r3965383159


##########
catalogs/hive-metastore-common/src/main/java/org/apache/gravitino/hive/client/HiveShimV2.java:
##########
@@ -148,10 +151,22 @@ public HiveTable getTable(String catalogName, String 
databaseName, String tableN
 
   @Override
   public void alterTable(
-      String catalogName, String databaseName, String tableName, HiveTable 
alteredHiveTable) {
+      String catalogName,
+      String databaseName,
+      String tableName,
+      HiveTable alteredHiveTable,
+      boolean skipStatsUpdate) {
     try {
       var tb = HiveTableConverter.toHiveTable(alteredHiveTable);
-      client.alter_table(databaseName, tableName, tb);
+      if (skipStatsUpdate) {
+        // Instruct the metastore not to recompute statistics for this alter, 
so it does not access
+        // the table's storage location. Hive 2.x has no catalog-aware alter, 
so the database name
+        // is used directly.
+        client.alter_table_with_environmentContext(
+            databaseName, tableName, tb, doNotUpdateStatsContext());

Review Comment:
   Done. Both Hive2 and Hive3 integration paths now cover it.



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

Reply via email to