difin commented on code in PR #4348:
URL: https://github.com/apache/hive/pull/4348#discussion_r1232756922


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreServerUtils.java:
##########
@@ -546,9 +548,17 @@ public static void 
updateTableStatsForCreateTable(Warehouse wh, Database db, Tab
       }
     }
 
-    if (MetastoreConf.getBoolVar(conf, 
MetastoreConf.ConfVars.STATS_AUTO_GATHER)) {
+    boolean isIcebergTable = Optional.ofNullable(tbl.getParameters())
+            .orElse(Collections.emptyMap())
+            .getOrDefault(TABLE_TYPE_PROP, "undefined")
+            .equals(ICEBERG_TABLE_TYPE_VALUE);
+
+    if (MetastoreConf.getBoolVar(conf, 
MetastoreConf.ConfVars.STATS_AUTO_GATHER) && !isIcebergTable) {

Review Comment:
   If in the configuration the stats source is defined as iceberg and we create 
an iceberg table and put `StatsSetupConst.DO_NOT_UPDATE_STATS=true into table's 
parameters` and then later after table creation user changes configuration 
setting of stats source to be metastore instead of iceberg, the stats source 
for the table will remain iceberg which is incorrect. `STATS_AUTO_GATHER` can't 
also be disabled globally in the configuration because this would affect all 
table types, not only iceberg.



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