Skip to content

Commit

Permalink
Allow setting hive conf which doesn't have a hivevar (#39)
Browse files Browse the repository at this point in the history
* Allow setting hive conf which doesn't have a hivevar
* Add changelog and unit test for setting hive conf
  • Loading branch information
amalakar committed May 12, 2020
1 parent 52fc718 commit 6dc0e83
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,9 @@
- `hotels-oss-parent` version updated to `4.2.0` (was `4.1.0`).
- Upgraded version of `hive.version` to `2.3.7` (was `2.3.4`). Allows BeeJU to be used on JDK>=9.

### Added
- Support for setting Hive conf using arbitrary string as conf key.

## [3.0.1] - 2019-09-27
### Changed
- `HiveMetaStoreJUnitExtension` and `HiveServer2JUnitExtension` constructors made public to allow access to classes outside of the extensions package.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/hotels/beeju/core/BeejuCore.java
Expand Up @@ -101,6 +101,10 @@ void setHiveVar(HiveConf.ConfVars variable, String value) {
conf.setVar(variable, value);
}

void setHiveConf(String variable, String value) {
conf.set(variable, value);
}

void setHiveIntVar(HiveConf.ConfVars variable, int value) {
conf.setIntVar(variable, value);
}
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/com/hotels/beeju/core/BeejuCoreTest.java
Expand Up @@ -77,6 +77,12 @@ public void setHiveVar() {
assertThat(defaultCore.conf().getVar(HiveConf.ConfVars.METASTORECONNECTURLKEY), is("test"));
}

@Test
public void setHiveConf() {
defaultCore.setHiveConf("my.custom.key", "test");
assertThat(defaultCore.conf().get("my.custom.key"), is("test"));
}

@Test
public void setHiveIntVar() {
defaultCore.setHiveIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT, 00000);
Expand Down

0 comments on commit 6dc0e83

Please sign in to comment.