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

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

                Author: ASF GitHub Bot
            Created on: 23/Aug/21 09:38
            Start Date: 23/Aug/21 09:38
    Worklog Time Spent: 10m 
      Work Description: abstractdog commented on a change in pull request #2478:
URL: https://github.com/apache/hive/pull/2478#discussion_r693817683



##########
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExclusiveReplica.java
##########
@@ -710,7 +710,6 @@ private void verifyCustomDBLocations(String srcDb, 
List<String> listOfTables, St
               replicatedDbName.toLowerCase()  + ".db").toUri().getPath());
     } else {
       Assert.assertNotEquals(managedCustLocOnSrc,  null);
-      Assert.assertEquals(replDatabase.getManagedLocationUri(),  null);

Review comment:
       @pkumarsinha: could you please confirm if removing this assertion won't 
hide any problems with replication?
   this patch takes care of setting managed location uri if it's not set by 
create database




-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 640646)
    Time Spent: 1h 20m  (was: 1h 10m)

> Create database query doesn't create MANAGEDLOCATION directory
> --------------------------------------------------------------
>
>                 Key: HIVE-25331
>                 URL: https://issues.apache.org/jira/browse/HIVE-25331
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Robbie Zhang
>            Assignee: Robbie Zhang
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> If we don't assign MANAGEDLOCATION in a "create database" query, the 
> MANAGEDLOCATION will be NULL so HMS doesn't create the directory. In this 
> case, a CTAS query immediately after the CREATE DATABASE query might fail in 
> MOVE task due to "destination's parent does not exist". I can use the 
> following script to reproduce this issue:
> {code:java}
> set hive.support.concurrency=true;
> set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
> create database testdb location '/tmp/testdb.db';
> create table testdb.test as select 1;
> {code}
> If the staging directory is under the MANAGEDLOCATION directory, the CTAS 
> query is fine as the MANAGEDLOCATION directory is created while creating the 
> staging directory. Since we set LOCATION to a default directory when LOCATION 
> is not assigned in the CREATE DATABASE query, I believe it's worth to set 
> MANAGEDLOCATION to a default directory, too.



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

Reply via email to