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