Skip to content

Commit

Permalink
Fix metastore tunnel creation when hive configuration properties are …
Browse files Browse the repository at this point in the history
…not set (#210)
  • Loading branch information
andreeapad authored Mar 4, 2021
1 parent e2b3bce commit 8426e45
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [3.9.1] - TBD
### Fixed
* Null pointer exception when creating a metastore tunnel by adding a check for null `configuration-properties`.

## [3.9.0] - 2021-02-26
### Added
* Support for setting Hive metastore filter hooks which can be configured per federated metastore. See the [README](https://github.com/HotelsDotCom/waggle-dance#federation) for more information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public CloseableThriftHiveMetastoreIface newInstance(

Map<String, String> properties = new HashMap<>();
properties.put(ConfVars.METASTOREURIS.varname, uri);
if (configurationProperties != null) {
properties.putAll(configurationProperties);
}
HiveConfFactory confFactory = new HiveConfFactory(Collections.<String>emptyList(), properties);
HiveConf localHiveConf = localHiveConfFactory.newInstance(localHost, localPort, confFactory.newInstance());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ public void newInstance() {
assertThat(tunnelable, is(hiveMetaStoreClientSupplier));
}

@Test
public void newInstanceNullConfigurationProperties() {
tunnelingMetaStoreClientFactory.newInstance(METASTORE_URI, metastoreTunnel, NAME, RECONNECTION_RETRIES,
CONNECTION_TIMEOUT, null);
}

@Test
public void newInstanceMultipleUris() {
String metastoreUris = METASTORE_URI + ",thrift://metastore-host2:43";
Expand Down

0 comments on commit 8426e45

Please sign in to comment.