Skip to content

Commit 2181d15

Browse files
author
Jennifer Baldwin
committed
OTF-3536 update for compatibility with hive 4.0.1
1 parent 8de94f4 commit 2181d15

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
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("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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ public void initialize(String inputName, Map<String, String> properties) {
104104
}
105105

106106
if (properties.containsKey(CatalogProperties.URI)) {
107-
this.conf.set(HiveConf.ConfVars.METASTOREURIS.varname, properties.get(CatalogProperties.URI));
107+
this.conf.set("hive.metastore.uris", properties.get(CatalogProperties.URI));
108108
}
109109

110110
if (properties.containsKey(CatalogProperties.WAREHOUSE_LOCATION)) {
111111
this.conf.set(
112-
HiveConf.ConfVars.METASTOREWAREHOUSE.varname,
112+
"hive.metastore.warehouse.dir",
113113
LocationUtil.stripTrailingSlash(properties.get(CatalogProperties.WAREHOUSE_LOCATION)));
114114
}
115115

@@ -796,7 +796,7 @@ Database convertToDatabase(Namespace namespace, Map<String, String> meta) {
796796
public String toString() {
797797
return MoreObjects.toStringHelper(this)
798798
.add("name", name)
799-
.add("uri", this.conf == null ? "" : this.conf.get(HiveConf.ConfVars.METASTOREURIS.varname))
799+
.add("uri", this.conf == null ? "" : this.conf.get("hive.metastore.uris"))
800800
.toString();
801801
}
802802

0 commit comments

Comments
 (0)