[ 
https://issues.apache.org/jira/browse/HIVE-24175?focusedWorklogId=571436&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-571436
 ]

ASF GitHub Bot logged work on HIVE-24175:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Mar/21 19:31
            Start Date: 24/Mar/21 19:31
    Worklog Time Spent: 10m 
      Work Description: nrg4878 commented on a change in pull request #2094:
URL: https://github.com/apache/hive/pull/2094#discussion_r600816065



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDefaultTransformer.java
##########
@@ -695,7 +695,8 @@ public Database transformDatabase(Database db, List<String> 
processorCapabilitie
     if (!isTenantBasedStorage) {
       Path locationPath = Path.getPathWithoutSchemeAndAuthority(new 
Path(db.getLocationUri()));
       Path whRootPath = 
Path.getPathWithoutSchemeAndAuthority(hmsHandler.getWh().getWhRoot());
-      if (FileUtils.isSubdirectory(whRootPath.toString(), 
locationPath.toString())) { // legacy path
+      LOG.debug("Comparing DB and warehouse paths warehouse={} 
db.getLocationUri={}", whRootPath.toString(), locationPath.toString());
+      if (FileUtils.isSubdirectory(whRootPath.toString(), 
locationPath.toString()) || locationPath.equals(whRootPath)) { // legacy path

Review comment:
       so prior to the introduction of managedlocation for db, while the exact 
semantics are unclear, the location was meant to be for managed tables. 
Although there is no code that enforces this strictly. So a legacy db object 
could have a location that could point anywhere. 
   This fix it for backward compatibility. When a location is set to a managed 
location, we are ensuring that that location now becomes the managedlocation.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 571436)
    Time Spent: 40m  (was: 0.5h)

> Ease database managed location restrictions in HMS translation
> --------------------------------------------------------------
>
>                 Key: HIVE-24175
>                 URL: https://issues.apache.org/jira/browse/HIVE-24175
>             Project: Hive
>          Issue Type: Sub-task
>    Affects Versions: 4.0.0
>            Reporter: Naveen Gangam
>            Assignee: Naveen Gangam
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Currently, HMS translation layer restricts the path of database's managed 
> location to be within hive warehouse. so a getDatabase call will return a 
> managedlocation path that adheres to this restriction regardless of what has 
> been set in the HMS DB. This leads to issues like having inconsistent paths 
> if hive-site.xml is not in sync across HMS and HS2 instances or even 
> different HMS instances as each instance has a different version of warehouse 
> root.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to