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 5aa9d16 [Zeppelin-4765] Fix mongodb interpreter: missing dependency 5aa9d16 is described below commit 5aa9d16b5d20a81204aee779c8de2564a077df06 Author: Christoph Nölle <19640096+cnoe...@users.noreply.github.co> AuthorDate: Thu Jun 24 01:19:07 2021 +0200 [Zeppelin-4765] Fix mongodb interpreter: missing dependency ### What is this PR for? Adds a missing dependency for the mongodb interpreter. ### What type of PR is it? Bug Fix ### Todos ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-4765 ### How should this be 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: Christoph Nölle <19640096+cnoe...@users.noreply.github.co> Author: cnoelle <19640096+cnoe...@users.noreply.github.com> Closes #4151 from cnoelle/ZEPPELIN-4765 and squashes the following commits: 0087d62eb [cnoelle] Merge branch 'apache:master' into ZEPPELIN-4765 e8da449d0 [Christoph Nölle] mongodb interpreter: add missing dependency lang3 --- mongodb/pom.xml | 4 ++++ .../java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mongodb/pom.xml b/mongodb/pom.xml index 5653bd1..2c212f4 100644 --- a/mongodb/pom.xml +++ b/mongodb/pom.xml @@ -42,6 +42,10 @@ <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + </dependency> </dependencies> <build> diff --git a/mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java b/mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java index b812b68..990909a 100644 --- a/mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java +++ b/mongodb/src/main/java/org/apache/zeppelin/mongodb/MongoDbInterpreter.java @@ -67,14 +67,13 @@ public class MongoDbInterpreter extends Interpreter { @Override public void open() { - shellExtension = new Scanner(MongoDbInterpreter.class.getResourceAsStream("/shell_extension.js"), "UTF-8") - .useDelimiter("\\A").next(); - + try (final Scanner scanner = new Scanner(MongoDbInterpreter.class.getResourceAsStream("/shell_extension.js"), + "UTF-8").useDelimiter("\\A")) { + shellExtension = scanner.next(); + } commandTimeout = Long.parseLong(getProperty("mongo.shell.command.timeout")); maxConcurrency = Integer.parseInt(getProperty("mongo.interpreter.concurrency.max")); - dbAddress = getProperty("mongo.server.host") + ":" + getProperty("mongo.server.port"); - prepareShellExtension(); } @@ -150,7 +149,6 @@ public class MongoDbInterpreter extends Interpreter { FileUtils.deleteQuietly(scriptFile); stopProcess(paragraphId); } - return result; }