This is an automated email from the ASF dual-hosted git repository. zjffdu pushed a commit to branch branch-0.9 in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/branch-0.9 by this push: new c8db6dd [ZEPPELIN-4885]. Add property to specify Module order of flink interpreter c8db6dd is described below commit c8db6dd92c3a57364c12ba6b5af607cc7098aae5 Author: Jeff Zhang <zjf...@apache.org> AuthorDate: Tue Jun 16 16:11:27 2020 +0800 [ZEPPELIN-4885]. Add property to specify Module order of flink interpreter ### What is this PR for? It is a trivial PR which add property `zeppelin.flink.module.enableHive` to control whether load hive udf first when there's same udf name in both hive and flink. ### What type of PR is it? [Improvement] ### Todos * [ ] - Task ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-4885 ### How should this be tested? * CI pass, and manually tested. ### 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: Jeff Zhang <zjf...@apache.org> Closes #3802 from zjffdu/ZEPPELIN-4885 and squashes the following commits: 45754580f [Jeff Zhang] [ZEPPELIN-4885]. Add property to specify Module order of flink interpreter (cherry picked from commit 72c127f79dbe2f4be55b6b7893f387aeb36248c6) Signed-off-by: Jeff Zhang <zjf...@apache.org> --- docs/interpreter/flink.md | 5 +++++ flink/interpreter/src/main/resources/interpreter-setting.json | 7 +++++++ .../scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala | 4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/interpreter/flink.md b/docs/interpreter/flink.md index dc79969..c0d8b2c 100644 --- a/docs/interpreter/flink.md +++ b/docs/interpreter/flink.md @@ -207,6 +207,11 @@ You can also set other flink properties which are not listed in the table. For a <td>Hive version that you would like to connect</td> </tr> <tr> + <td>zeppelin.flink.module.enableHive</td> + <td>false</td> + <td>Whether enable hive module, hive udf take precedence over flink udf if hive module is enabled.</td> + </tr> + <tr> <td>zeppelin.flink.maxResult</td> <td>1000</td> <td>max number of row returned by sql interpreter</td> diff --git a/flink/interpreter/src/main/resources/interpreter-setting.json b/flink/interpreter/src/main/resources/interpreter-setting.json index eea51a4..c8bdbbe 100644 --- a/flink/interpreter/src/main/resources/interpreter-setting.json +++ b/flink/interpreter/src/main/resources/interpreter-setting.json @@ -152,6 +152,13 @@ "description": "Hive version that you would like to connect", "type": "string" }, + "zeppelin.flink.module.enableHive": { + "envName": null, + "propertyName": null, + "defaultValue": false, + "description": "Whether enable hive module, hive udf take precedence over flink udf if hive module is enabled.", + "type": "checkbox" + }, "zeppelin.flink.printREPLOutput": { "envName": null, "propertyName": "zeppelin.flink.printREPLOutput", diff --git a/flink/interpreter/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala b/flink/interpreter/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala index 2431d01..027838e 100644 --- a/flink/interpreter/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala +++ b/flink/interpreter/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala @@ -466,7 +466,9 @@ class FlinkScalaInterpreter(val properties: Properties) { this.btenv.registerCatalog("hive", hiveCatalog) this.btenv.useCatalog("hive") this.btenv.useDatabase(database) - this.btenv.loadModule("hive", new HiveModule(hiveVersion)) + if (properties.getProperty("zeppelin.flink.module.enableHive", "false").toBoolean) { + this.btenv.loadModule("hive", new HiveModule(hiveVersion)) + } } private def loadUDFJar(jar: String): Unit = {