deniskuzZ commented on code in PR #3802:
URL: https://github.com/apache/hive/pull/3802#discussion_r1035628537
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -236,11 +236,25 @@ public void
commitCreateTable(org.apache.hadoop.hive.metastore.api.Table hmsTabl
setFileFormat(catalogProperties.getProperty(TableProperties.DEFAULT_FILE_FORMAT));
String metadataLocation =
hmsTable.getParameters().get(BaseMetastoreTableOperations.METADATA_LOCATION_PROP);
+ Table table;
if (metadataLocation != null) {
- Catalogs.registerTable(conf, catalogProperties, metadataLocation);
+ table = Catalogs.registerTable(conf, catalogProperties,
metadataLocation);
} else {
- Catalogs.createTable(conf, catalogProperties);
+ table = Catalogs.createTable(conf, catalogProperties);
}
+
+ if
(!Boolean.parseBoolean(catalogProperties.getProperty(hive_metastoreConstants.TABLE_IS_CTAS)))
{
+ return;
+ }
+
+ // set this in the query state so that we can rollback the table in the
lifecycle hook in case of failures
+ SessionStateUtil.addResource(conf, InputFormatConfig.CTAS_TABLE_NAME,
+ catalogProperties.getProperty(Catalogs.NAME));
+
+ String tableIdentifier = catalogProperties.getProperty(Catalogs.NAME);
Review Comment:
use `tableIdentifier` in above statement as well:
````
SessionStateUtil.addResource(conf, InputFormatConfig.CTAS_TABLE_NAME,
tableIdentifier)
````
--
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]