ayushtkn commented on code in PR #4341:
URL: https://github.com/apache/hive/pull/4341#discussion_r1213915718
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -171,6 +172,16 @@ public void
preCreateTable(org.apache.hadoop.hive.metastore.api.Table hmsTable)
hmsTable.getParameters().put(BaseMetastoreTableOperations.TABLE_TYPE_PROP,
BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE.toUpperCase());
+ // Make sure the created iceberg table location on external warehouse
location
+ if (Catalogs.hiveCatalog(conf, catalogProperties) &&
hmsTable.getSd().getLocation() == null &&
+ !TableType.EXTERNAL_TABLE.equals(hmsTable.getTableType())) {
+ Map<String, String> params =
Optional.ofNullable(hmsTable.getParameters()).orElse(Maps.newHashMap());
+ params.put("EXTERNAL", "TRUE");
+ params.put(MetaStoreUtils.EXTERNAL_TABLE_PURGE, "TRUE");
+ hmsTable.setParameters(params);
+ hmsTable.setTableType(TableType.EXTERNAL_TABLE.toString());
Review Comment:
I think put external only when the transformer is null, else let it go its
own way.
Some output were changing, like the table was managed and now external, I
think for those we can regenerate the output
--
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]