lcspinter commented on a change in pull request #2173:
URL: https://github.com/apache/hive/pull/2173#discussion_r612986935



##########
File path: 
iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java
##########
@@ -190,6 +180,78 @@ public void 
commitDropTable(org.apache.hadoop.hive.metastore.api.Table hmsTable,
     }
   }
 
+  @Override
+  public void preAlterTable(org.apache.hadoop.hive.metastore.api.Table 
hmsTable, EnvironmentContext context)
+      throws MetaException {
+    HiveMetaHook.super.preAlterTable(hmsTable, context);
+    catalogProperties = getCatalogProperties(hmsTable);
+    try {
+      icebergTable = Catalogs.loadTable(conf, catalogProperties);
+    } catch (NoSuchTableException nte) {
+      // If the iceberg table does not exist, and the hms table is external 
and not temporary, not acid,
+      // and not bucketed, we will create it in commitAlterTable
+      StorageDescriptor sd = hmsTable.getSd();
+      generateMetadata = MetaStoreUtils.isExternalTable(hmsTable) && 
!hmsTable.isTemporary() &&
+          !(sd.getNumBuckets() > 0) && 
!AcidUtils.isTransactionalTable(hmsTable);

Review comment:
       It turns out we can :). Removed this condition. 




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

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