deniskuzZ commented on code in PR #4880:
URL: https://github.com/apache/hive/pull/4880#discussion_r1409243580
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1640,7 +1681,17 @@ public boolean
shouldOverwrite(org.apache.hadoop.hive.ql.metadata.Table mTable,
}
@Override
- public void addResourcesForCreateTable(Map<String, String> tblProps,
HiveConf hiveConf) {
+ public void addResourcesForCreateTable(Map<String, String> tblProps,
HiveConf hiveConf, Hive db,
+ TableName qualifiedTabName, boolean isExt) throws MetaException,
HiveException {
+ Optional<String> defaultTableLocation =
+ SessionStateUtil.getProperty(conf,
hive_metastoreConstants.DEFAULT_TABLE_LOCATION);
+ if (!defaultTableLocation.isPresent()) {
+ Warehouse wh = new Warehouse(conf);
Review Comment:
you can just extract in SA method `getDefaultTablePath`
````
private String getDefaultTablePath(TableName qualifiedTabName, boolean
isExt) throws SemanticException {
String tblLocation;
try {
Warehouse wh = new Warehouse(conf);
tblLocation =
wh.getDefaultTablePath(db.getDatabase(qualifiedTabName.getDb()),
qualifiedTabName.getTable(),
isExt).toUri().getPath();
} catch (MetaException | HiveException e) {
throw new SemanticException(e);
}
return tblLocation;
}
````
--
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]