Repository: zeppelin Updated Branches: refs/heads/master 07d1fa228 -> 4054320a4
ZEPPELIN-3034. Only apply dynamic form for LivySqlnterpreter ### What is this PR for? Simple PR to only apply dynamic forms for LivySqlInterpreter, this make the behavior consistent with zeppelin's built-in spark interpreter. ### What type of PR is it? [Bug Fix] ### Todos * [ ] - Task ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-3034 ### 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 <[email protected]> Closes #2651 from zjffdu/ZEPPELIN-3034 and squashes the following commits: 39eff37 [Jeff Zhang] ZEPPELIN-3034. Only apply dynamic form for LivySqlnterpreter Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/4054320a Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/4054320a Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/4054320a Branch: refs/heads/master Commit: 4054320a443fbcb6c14225c589f56c01ea8b4eaa Parents: 07d1fa2 Author: Jeff Zhang <[email protected]> Authored: Sun Nov 5 19:35:14 2017 +0800 Committer: Jeff Zhang <[email protected]> Committed: Mon Nov 6 15:42:54 2017 +0800 ---------------------------------------------------------------------- docs/interpreter/livy.md | 9 +++++---- .../java/org/apache/zeppelin/livy/BaseLivyInterpreter.java | 2 +- .../org/apache/zeppelin/livy/LivySparkSQLInterpreter.java | 5 +++++ 3 files changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4054320a/docs/interpreter/livy.md ---------------------------------------------------------------------- diff --git a/docs/interpreter/livy.md b/docs/interpreter/livy.md index 09bf6e1..d53672a 100644 --- a/docs/interpreter/livy.md +++ b/docs/interpreter/livy.md @@ -208,13 +208,14 @@ i.e. sends extra parameter for creating and running a session ("proxyUser": "${l This is particularly useful when multi users are sharing a Notebook server. ## Apply Zeppelin Dynamic Forms -You can leverage [Zeppelin Dynamic Form](../usage/dynamic_form/intro.html). You can use both the `text input` and `select form` parameterization features. - +You can leverage [Zeppelin Dynamic Form](../usage/dynamic_form/intro.html). Form templates is only avalible for livy sql interpreter. ``` -%livy.pyspark -print "${group_by=product_id,product_id|product_name|customer_id|store_id}" +%livy.sql +select * from products where ${product_id=1} ``` +And creating dynamic formst programmatically is not feasible in livy interpreter, because ZeppelinContext is not available in livy interpreter. + ## FAQ Livy debugging: If you see any of these in error console http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4054320a/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterpreter.java ---------------------------------------------------------------------- diff --git a/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterpreter.java b/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterpreter.java index 0cdf464..f3b7579 100644 --- a/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterpreter.java +++ b/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterpreter.java @@ -251,7 +251,7 @@ public abstract class BaseLivyInterpreter extends Interpreter { @Override public FormType getFormType() { - return FormType.SIMPLE; + return FormType.NATIVE; } @Override http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4054320a/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java ---------------------------------------------------------------------- diff --git a/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java b/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java index 486e31c..b93626d 100644 --- a/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java +++ b/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java @@ -159,6 +159,11 @@ public class LivySparkSQLInterpreter extends BaseLivyInterpreter { } } + @Override + public FormType getFormType() { + return FormType.SIMPLE; + } + protected List<String> parseSQLOutput(String output) { List<String> rows = new ArrayList<>(); String[] lines = output.split("\n");
