You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by pd...@apache.org on 2021/09/28 06:32:02 UTC
[zeppelin] branch master updated: [ZEPPELIN-5540] fix the
unexpected NPE when use hive with Flink
This is an automated email from the ASF dual-hosted git repository.
pdallig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push:
new 5c52dd3 [ZEPPELIN-5540] fix the unexpected NPE when use hive with Flink
5c52dd3 is described below
commit 5c52dd38dae7d5bde49837e3df2eb0b68a305117
Author: taokelu <ta...@bytedance.com>
AuthorDate: Mon Sep 27 20:02:57 2021 +0800
[ZEPPELIN-5540] fix the unexpected NPE when use hive with Flink
### What is this PR for?
When we enable hive in Flink interpreter, we encounter the unexpected NPE. The root cause is the value `properties.getOrDefault("HIVE_CONF_DIR", System.getenv("HIVE_CONF_DIR"))` is null. It will throw NPE when apply the `toString()` method.
### What type of PR is it?
[Bug Fix ]
### Todos
None
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-5540
### How should this be tested?
CI pass
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: taokelu <ta...@bytedance.com>
Closes #4236 from legendtkl/fixNpeForFlinkInterpret and squashes the following commits:
6ec7c4b3a [taokelu] fix
f76132427 [taokelu] [ZEPPELIN-5540] fix the unexpected NPE when use hive in Flink Interpreter
---
.../main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala b/flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala
index 7729a5f..1545bcd 100644
--- a/flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala
+++ b/flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala
@@ -489,13 +489,13 @@ abstract class FlinkScalaInterpreter(val properties: Properties,
private def registerHiveCatalog(): Unit = {
val hiveConfDir =
- properties.getOrDefault("HIVE_CONF_DIR", System.getenv("HIVE_CONF_DIR")).toString
+ properties.getOrDefault("HIVE_CONF_DIR", System.getenv("HIVE_CONF_DIR"))
if (hiveConfDir == null) {
throw new InterpreterException("HIVE_CONF_DIR is not specified");
}
val database = properties.getProperty("zeppelin.flink.hive.database", "default")
val hiveVersion = properties.getProperty("zeppelin.flink.hive.version", "2.3.4")
- val hiveCatalog = new HiveCatalog("hive", database, hiveConfDir, hiveVersion)
+ val hiveCatalog = new HiveCatalog("hive", database, hiveConfDir.toString, hiveVersion)
this.btenv.registerCatalog("hive", hiveCatalog)
this.btenv.useCatalog("hive")
this.btenv.useDatabase(database)