marton-bod commented on a change in pull request #2173:
URL: https://github.com/apache/hive/pull/2173#discussion_r612548808
##########
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:
Can we not migrate a bucketed table to Iceberg? Would the table just
lose its bucketed property but otherwise the migration would succeed, or do we
run into some errors because of the way the execution plan is put together
differently for bucketed tables?
--
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]