You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Alan Gates <al...@gmail.com> on 2018/03/16 21:17:21 UTC

Possible bug in obtaining database paths

In the Warehouse class there are a couple of methods to determine the path
of a database:
getDatabasePath() and getDefaultDatabasePath().

getDatabasePath() reads the location out of the database object, except in
the case of the 'default' database, where it returns the warehouse root.

getDefaultDatabasePath constructs the database path based on the name of
the the database.  Thus this only works if the database does not have an
alternate location set.

But getDefaultDatabasePath is called in several places on a database
without checking whether the location is set, in LoadTable, LoadPartition,
and ImportSemanticAnalyzer.  I am fairly certain this is a bug, but I
wanted to check before I changed it.

Alan.