[ https://issues.apache.org/jira/browse/HIVE-26157?focusedWorklogId=769026&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-769026 ]
ASF GitHub Bot logged work on HIVE-26157: ----------------------------------------- Author: ASF GitHub Bot Created on: 11/May/22 12:01 Start Date: 11/May/22 12:01 Worklog Time Spent: 10m Work Description: lcspinter commented on code in PR #3226: URL: https://github.com/apache/hive/pull/3226#discussion_r870214863 ########## iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java: ########## @@ -457,9 +459,24 @@ public boolean isValidMetadataTable(String metaTableName) { public URI getURIForAuth(org.apache.hadoop.hive.metastore.api.Table hmsTable) throws URISyntaxException { String dbName = hmsTable.getDbName(); String tableName = hmsTable.getTableName(); - return new URI(ICEBERG_URI_PREFIX + dbName + "/" + tableName); + StringBuilder authURI = new StringBuilder(ICEBERG_URI_PREFIX).append(dbName).append("/").append(tableName) + .append("?snapshot="); + Optional<String> locationProperty = SessionStateUtil.getProperty(conf, hive_metastoreConstants.META_TABLE_LOCATION); + if (locationProperty.isPresent()) { + Preconditions.checkArgument(locationProperty.get() != null, Review Comment: I could remove it, but I think it doesn't hurt if we have an additional check validating the location. Issue Time Tracking ------------------- Worklog Id: (was: 769026) Time Spent: 4h 10m (was: 4h) > Change Iceberg storage handler authz URI to metadata location > ------------------------------------------------------------- > > Key: HIVE-26157 > URL: https://issues.apache.org/jira/browse/HIVE-26157 > Project: Hive > Issue Type: Improvement > Reporter: László Pintér > Assignee: László Pintér > Priority: Major > Labels: pull-request-available > Time Spent: 4h 10m > Remaining Estimate: 0h > > In HIVE-25964, the authz URI has been changed to "iceberg://db.table". > It is possible to set the metadata pointers of table A to point to table B, > and therefore you could read table B's data via querying table A. > {code:sql} > alter table A set tblproperties > ('metadata_location'='/path/to/B/snapshot.json', > 'previous_metadata_location'='/path/to/B/prev_snapshot.json'); {code} -- This message was sent by Atlassian Jira (v8.20.7#820007)