You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/11/17 07:13:00 UTC

[jira] [Work logged] (HIVE-26537) Deprecate older APIs in the HMS

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

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

                Author: ASF GitHub Bot
            Created on: 17/Nov/22 07:12
            Start Date: 17/Nov/22 07:12
    Worklog Time Spent: 10m 
      Work Description: dengzhhu653 commented on code in PR #3599:
URL: https://github.com/apache/hive/pull/3599#discussion_r1024824772


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java:
##########
@@ -1274,7 +1308,46 @@ public void createDatabase(Database db)
     if (!db.isSetCatalogName()) {
       db.setCatalogName(getDefaultCatalog(conf));
     }
-    client.create_database(db);
+    CreateDatabaseRequest req = new CreateDatabaseRequest();
+    req.setDatabaseName(db.getName());
+    if (db.isSetDescription()) {
+      req.setDescription(db.getDescription());
+    }
+    if (db.isSetLocationUri()) {
+      req.setLocationUri(db.getLocationUri());
+    }
+    if (db.isSetParameters()) {
+      req.setParameters(db.getParameters());
+    }
+    if (db.isSetPrivileges()) {
+      req.setPrivileges(db.getPrivileges());
+    }
+    if (db.isSetOwnerName()) {
+      req.setOwnerName(db.getOwnerName());
+    }
+    if (db.isSetOwnerType()) {

Review Comment:
   we can set property directly without null check, perhaps a database builder is helpful, for example:
   `
   new CreateDatabaseRequest.Builder(catName/**required args*/, dbName/**required args*/).createTime(time).location(uri).managedLocation(location).build()
   `
   This works for other request as well, such as `AppendPartitionsRequest`, `AddPartitionsRequest`, etc.





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

    Worklog Id:     (was: 826725)
    Time Spent: 2.5h  (was: 2h 20m)

> Deprecate older APIs in the HMS
> -------------------------------
>
>                 Key: HIVE-26537
>                 URL: https://issues.apache.org/jira/browse/HIVE-26537
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 4.0.0-alpha-1, 4.0.0-alpha-2
>            Reporter: Sai Hemanth Gantasala
>            Assignee: Sai Hemanth Gantasala
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> This Jira is to track the clean-up(deprecate older APIs and point the HMS client to the newer APIs) work in the hive metastore server.
> More details will be added here soon.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)