zhangbutao commented on code in PR #4341:
URL: https://github.com/apache/hive/pull/4341#discussion_r1208790260
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -225,6 +228,20 @@ public void
preCreateTable(org.apache.hadoop.hive.metastore.api.Table hmsTable)
setOrcOnlyFilesParam(hmsTable);
}
+ private void
checkAndSetTblLocation(org.apache.hadoop.hive.metastore.api.Table hmsTable) {
+ try {
+ if (Catalogs.hiveCatalog(conf, catalogProperties) &&
hmsTable.getSd().getLocation() == null) {
+ Warehouse wh = new Warehouse(conf);
+ Path tblPath = wh.getDefaultTablePath(hmsTable.getDbName(),
hmsTable.getTableName(),
+
TableType.EXTERNAL_TABLE.toString().equalsIgnoreCase(hmsTable.getTableType()));
+ hmsTable.getSd().setLocation(tblPath.toString());
+ catalogProperties.put(Catalogs.LOCATION, tblPath.toString());
Review Comment:
I rethink this way that checking `METASTORE_METADATA_TRANSFORMER_CLASS` in
HiveIcebergMetaHook to determine table location. It seems that the `conf ` in
HiveIcebergMetaHook is different from `conf ` in HMSHandler, and the value of
`METASTORE_METADATA_TRANSFORMER_CLASS` in MetaHook's `conf `is always
`org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer`. That is to
say, we can not check this actual value except HMSHandler.
Let me think how to do. :(
--
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]