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

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

                Author: ASF GitHub Bot
            Created on: 09/Jun/22 02:12
            Start Date: 09/Jun/22 02:12
    Worklog Time Spent: 10m 
      Work Description: zhangbutao commented on code in PR #3350:
URL: https://github.com/apache/hive/pull/3350#discussion_r893008968


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -2041,16 +2041,16 @@ public void drop_dataconnector(final String dcName, 
boolean ifNotExists, boolean
     Exception ex = null;
     RawStore ms = getMS();
     try {
-      ms.openTransaction();
       connector = getMS().getDataConnector(dcName);
-
-      if (connector == null) {
-        if (!ifNotExists) {
-          throw new NoSuchObjectException("DataConnector " + dcName + " 
doesn't exist");
-        } else {
-          return;
-        }
+    } catch (NoSuchObjectException e) {

Review Comment:
   Actually, we don't need to catch NoSuchObjectException any more after this 
change. But we still need these two lines L229 and L230 because each test will 
create data connector and we should ensure data connector is dropped before 
each creating. Database test is also doing same thing.
   
https://github.com/apache/hive/blob/6b1a876c3df7db54553e95552bcc2c99eccf8ae2/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestFilterHooks.java#L204-L212





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

    Worklog Id:     (was: 779753)
    Time Spent: 0.5h  (was: 20m)

> Drop data connector with argument ifNotExists(true) should not throw 
> NoSuchObjectException
> ------------------------------------------------------------------------------------------
>
>                 Key: HIVE-26299
>                 URL: https://issues.apache.org/jira/browse/HIVE-26299
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 4.0.0-alpha-2
>            Reporter: zhangbutao
>            Assignee: zhangbutao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to