Skip to content

Commit 6718864

Browse files
author
Jennifer Baldwin
committed
merge OTF-3536
1 parent 5152df2 commit 6718864

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import java.util.concurrent.TimeUnit;
3232
import javax.annotation.Nullable;
3333
import org.apache.hadoop.conf.Configuration;
34-
import org.apache.hadoop.hive.conf.HiveConf;
3534
import org.apache.hadoop.hive.metastore.IMetaStoreClient;
3635
import org.apache.hadoop.security.UserGroupInformation;
3736
import org.apache.iceberg.CatalogProperties;
@@ -132,7 +131,7 @@ public <R> R run(Action<R, IMetaStoreClient, TException> action, boolean retry)
132131
static Key extractKey(String cacheKeys, Configuration conf) {
133132
// generate key elements in a certain order, so that the Key instances are comparable
134133
List<Object> elements = Lists.newArrayList();
135-
elements.add(conf.get(HiveConf.ConfVars.METASTOREURIS.varname, ""));
134+
elements.add(conf.get(HiveCatalog.HIVE_METASTORE_URIS, ""));
136135
elements.add(conf.get(HiveCatalog.HIVE_CONF_CATALOG, "hive"));
137136
if (cacheKeys == null || cacheKeys.isEmpty()) {
138137
return Key.of(elements);

hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.stream.Collectors;
2525
import org.apache.hadoop.conf.Configurable;
2626
import org.apache.hadoop.conf.Configuration;
27-
import org.apache.hadoop.hive.conf.HiveConf;
2827
import org.apache.hadoop.hive.metastore.IMetaStoreClient;
2928
import org.apache.hadoop.hive.metastore.TableType;
3029
import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
@@ -82,6 +81,8 @@ public class HiveCatalog extends BaseMetastoreViewCatalog
8281

8382
// MetastoreConf is not available with current Hive version
8483
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";
8586

8687
private static final Logger LOG = LoggerFactory.getLogger(HiveCatalog.class);
8788

@@ -104,12 +105,12 @@ public void initialize(String inputName, Map<String, String> properties) {
104105
}
105106

106107
if (properties.containsKey(CatalogProperties.URI)) {
107-
this.conf.set(HiveConf.ConfVars.METASTOREURIS.varname, properties.get(CatalogProperties.URI));
108+
this.conf.set(HIVE_METASTORE_URIS, properties.get(CatalogProperties.URI));
108109
}
109110

110111
if (properties.containsKey(CatalogProperties.WAREHOUSE_LOCATION)) {
111112
this.conf.set(
112-
HiveConf.ConfVars.METASTOREWAREHOUSE.varname,
113+
HIVE_METASTORE_WAREHOUSE_DIR,
113114
LocationUtil.stripTrailingSlash(properties.get(CatalogProperties.WAREHOUSE_LOCATION)));
114115
}
115116

@@ -728,7 +729,7 @@ protected String defaultWarehouseLocation(TableIdentifier tableIdentifier) {
728729
}
729730

730731
private String databaseLocation(String databaseName) {
731-
String warehouseLocation = conf.get(HiveConf.ConfVars.METASTOREWAREHOUSE.varname);
732+
String warehouseLocation = conf.get(HIVE_METASTORE_WAREHOUSE_DIR);
732733
Preconditions.checkNotNull(
733734
warehouseLocation, "Warehouse location is not set: hive.metastore.warehouse.dir=null");
734735
warehouseLocation = LocationUtil.stripTrailingSlash(warehouseLocation);
@@ -796,7 +797,7 @@ Database convertToDatabase(Namespace namespace, Map<String, String> meta) {
796797
public String toString() {
797798
return MoreObjects.toStringHelper(this)
798799
.add("name", name)
799-
.add("uri", this.conf == null ? "" : this.conf.get(HiveConf.ConfVars.METASTOREURIS.varname))
800+
.add("uri", this.conf == null ? "" : this.conf.get(HIVE_METASTORE_URIS))
800801
.toString();
801802
}
802803

0 commit comments

Comments
 (0)