deniskuzZ commented on code in PR #4880:
URL: https://github.com/apache/hive/pull/4880#discussion_r1405834393
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1011,25 +1018,31 @@ public URI
getURIForAuth(org.apache.hadoop.hive.metastore.api.Table hmsTable) th
Optional<String> metadataLocation =
SessionStateUtil.getProperty(conf,
BaseMetastoreTableOperations.METADATA_LOCATION_PROP);
if (metadataLocation.isPresent()) {
- authURI.append(encodeString(metadataLocation.get()));
+ authURI.append(encodeString(getLocation(metadataLocation.get(),
getDefaultCreateLocation(), conf)));
} else {
Optional<String> locationProperty =
SessionStateUtil.getProperty(conf,
hive_metastoreConstants.META_TABLE_LOCATION);
if (locationProperty.isPresent()) {
// this property is set during the create operation before the hive
table was created
// we are returning a dummy iceberg metadata file
-
authURI.append(encodeString(URI.create(locationProperty.get()).getPath()))
+ authURI.append(encodeString(
+ getLocation(URI.create(locationProperty.get()).getPath(),
getDefaultCreateLocation(), conf)))
.append(encodeString("/metadata/dummy.metadata.json"));
} else {
Table table = IcebergTableUtil.getTable(conf, hmsTable);
- authURI.append(
- encodeString(URI.create(((BaseTable)
table).operations().current().metadataFileLocation()).getPath()));
+ authURI.append(encodeString(URI.create(
+ getLocation(((BaseTable)
table).operations().current().metadataFileLocation(),
+ hmsTable.getSd().getLocation(), conf)).getPath()));
}
}
LOG.debug("Iceberg storage handler authorization URI {}", authURI);
return new URI(authURI.toString());
}
+ private String getDefaultCreateLocation() {
Review Comment:
no need for this method, just use it inside `getPathForAuth`
--
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]