deniskuzZ commented on code in PR #6267:
URL: https://github.com/apache/hive/pull/6267#discussion_r3068071794


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java:
##########
@@ -279,27 +330,56 @@ public Path getDefaultDatabasePath(String dbName) throws 
MetaException {
     return getDefaultDatabasePath(dbName, false);
   }
 
+  public Path getDefaultDatabasePath(Database db) throws MetaException {
+    return getDefaultDatabasePath(db, false);
+  }
+
+  /**
+   * @deprecated use {@link #getDefaultExternalDatabasePath(Database)}
+   */
   public Path getDefaultExternalDatabasePath(String dbName) throws 
MetaException {
     return getDefaultDatabasePath(dbName, true);
   }
 
+  public Path getDefaultExternalDatabasePath(Database db) throws MetaException 
{
+    return getDefaultDatabasePath(db, true);
+  }
+
+  /**
+   * @deprecated use {@link #getDefaultDatabasePath(Database, boolean)}
+   */
   // should only be used to determine paths before the creation of databases
   public Path getDefaultDatabasePath(String dbName, boolean inExternalWH) 
throws MetaException {
-    if (inExternalWH) {
-      if (dbName.equalsIgnoreCase(DEFAULT_DATABASE_NAME)) {
-        return getWhRootExternal();
-      }
-      return new Path(getWhRootExternal(), dbName.toLowerCase() + 
DATABASE_WAREHOUSE_SUFFIX);
-    } else {
-      if (dbName.equalsIgnoreCase(DEFAULT_DATABASE_NAME)) {
-        return getWhRoot();
-      }
-      return new Path(getWhRoot(), dbName.toLowerCase() + 
DATABASE_WAREHOUSE_SUFFIX);
+    Database db = new Database();

Review Comment:
   are you using Database only as a DTO object? instead you could use a record 
CatalogDb as mentioned earlier



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

Reply via email to