Repository: zeppelin Updated Branches: refs/heads/branch-0.7 c0e2ab657 -> 50b7d235f
ZEPPELIN-3034. Only apply dynamic form for LivySqlnterpreter Simple PR to only apply dynamic forms for LivySqlInterpreter, this make the behavior consistent with zeppelin's built-in spark interpreter. [Bug Fix] * [ ] - Task * https://issues.apache.org/jira/browse/ZEPPELIN-3034 * 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 (cherry picked from commit 4054320a443fbcb6c14225c589f56c01ea8b4eaa) Signed-off-by: Jeff Zhang <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/50b7d235 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/50b7d235 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/50b7d235 Branch: refs/heads/branch-0.7 Commit: 50b7d235f4e1eaeffb7ff891d7cfc84cce0b9488 Parents: c0e2ab6 Author: Jeff Zhang <[email protected]> Authored: Sun Nov 5 19:35:14 2017 +0800 Committer: Jeff Zhang <[email protected]> Committed: Mon Nov 6 15:45:33 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/50b7d235/docs/interpreter/livy.md ---------------------------------------------------------------------- diff --git a/docs/interpreter/livy.md b/docs/interpreter/livy.md index 132f327..b70016e 100644 --- a/docs/interpreter/livy.md +++ b/docs/interpreter/livy.md @@ -200,13 +200,14 @@ This is particularly useful when multi users are sharing a Notebook server. ## Apply Zeppelin Dynamic Forms -You can leverage [Zeppelin Dynamic Form](../manual/dynamicform.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/50b7d235/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 2c92bbf..67220b4 100644 --- a/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterpreter.java +++ b/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterpreter.java @@ -190,7 +190,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/50b7d235/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 9a51971..05667bb 100644 --- a/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java +++ b/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java @@ -146,6 +146,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");
