You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "saihemanth-cloudera (via GitHub)" <gi...@apache.org> on 2023/05/30 21:27:38 UTC

[GitHub] [hive] saihemanth-cloudera commented on a diff in pull request #3599: HIVE-26537: Deprecate older APIs in the HMS thrift interface.

saihemanth-cloudera commented on code in PR #3599:
URL: https://github.com/apache/hive/pull/3599#discussion_r1210841291


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -1335,18 +1335,42 @@ private void create_database_core(RawStore ms, final Database db)
   }
 
   @Override
+  @Deprecated
   public void create_database(final Database db)
       throws AlreadyExistsException, InvalidObjectException, MetaException {
-    startFunction("create_database", ": " + db.toString());
+    CreateDatabaseRequest req = new CreateDatabaseRequest(db.getName());
+    req.setDescription(db.getDescription());
+    req.setLocationUri(db.getLocationUri());
+    req.setParameters(db.getParameters());
+    req.setPrivileges(db.getPrivileges());
+    req.setOwnerName(db.getOwnerName());
+    req.setOwnerType(db.getOwnerType());
+    req.setCatalogName(db.getCatalogName());
+    req.setCreateTime(db.getCreateTime());
+    req.setManagedLocationUri(db.getManagedLocationUri());
+    req.setType(db.getType());
+    req.setDataConnectorName(db.getConnector_name());
+    req.setRemote_dbname(db.getRemote_dbname());
+
+    create_database_req(req);
+    //location and manged location might be set/changed.
+    db.setLocationUri(req.getLocationUri());

Review Comment:
   I actually thought that tests are using the `db` to assert on the location but looks like none of the tests are doing it. My only concern is, the old client, may be expecting a modified location that will no more be compatible with this change. So, if we are not removing the old/deprecated APIs in this version then it is safe to keep this or else we can remove it otherwise.



-- 
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-unsubscribe@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org