@@ -81,6 +81,8 @@ public class HiveCatalog extends BaseMetastoreViewCatalog
8181
8282 // MetastoreConf is not available with current Hive version
8383 static final String HIVE_CONF_CATALOG = "metastore.catalog.default" ;
84+ static final String HIVE_METASTORE_WAREHOUSE_DIR = "hive.metastore.warehouse.dir" ;
85+ static final String HIVE_METASTORE_URIS = "hive.metastore.uris" ;
8486
8587 private static final Logger LOG = LoggerFactory .getLogger (HiveCatalog .class );
8688
@@ -103,12 +105,12 @@ public void initialize(String inputName, Map<String, String> properties) {
103105 }
104106
105107 if (properties .containsKey (CatalogProperties .URI )) {
106- this .conf .set ("hive.metastore.uris" , properties .get (CatalogProperties .URI ));
108+ this .conf .set (HIVE_METASTORE_URIS , properties .get (CatalogProperties .URI ));
107109 }
108110
109111 if (properties .containsKey (CatalogProperties .WAREHOUSE_LOCATION )) {
110112 this .conf .set (
111- "hive.metastore.warehouse.dir" ,
113+ HIVE_METASTORE_WAREHOUSE_DIR ,
112114 LocationUtil .stripTrailingSlash (properties .get (CatalogProperties .WAREHOUSE_LOCATION )));
113115 }
114116
@@ -727,7 +729,7 @@ protected String defaultWarehouseLocation(TableIdentifier tableIdentifier) {
727729 }
728730
729731 private String databaseLocation (String databaseName ) {
730- String warehouseLocation = conf .get ("hive.metastore.warehouse.dir" );
732+ String warehouseLocation = conf .get (HIVE_METASTORE_WAREHOUSE_DIR );
731733 Preconditions .checkNotNull (
732734 warehouseLocation , "Warehouse location is not set: hive.metastore.warehouse.dir=null" );
733735 warehouseLocation = LocationUtil .stripTrailingSlash (warehouseLocation );
@@ -795,7 +797,7 @@ Database convertToDatabase(Namespace namespace, Map<String, String> meta) {
795797 public String toString () {
796798 return MoreObjects .toStringHelper (this )
797799 .add ("name" , name )
798- .add ("uri" , this .conf == null ? "" : this .conf .get ("hive.metastore.uris" ))
800+ .add ("uri" , this .conf == null ? "" : this .conf .get (HIVE_METASTORE_URIS ))
799801 .toString ();
800802 }
801803
0 commit comments