Is it possible to set global variables in a Zeppelin Notebook?

柔情痞子 提交于 2019-12-04 22:30:05

问题


I'm trying to create a multi-paragraph dashboard using a Zeppelin notebook. I'd like people using the dashboard to only have to enter certain parameters once. E.g. if I'm making a dashboard with information about different websites, the dashboard user only has to select the particular website they want information about once and the whole multi-paragraph dashboard will update. Is this possible? How do I set global variables like this in a notebook?

To clarify, the parameter input that I intend to use for Zeppelin is referred to as "dynamic form".


回答1:


Using z.put and z.get can share variable over different notebooks.

z.put("name", "zeppelin")
z.get("name")

Possibly combine with z.angularBind and z.angular to use it in dashboard. ref How to put a variable into z ZeppelinContext in javascript in Zeppelin?




回答2:


You can use notebook-level global variables in the SQL by using the syntax $${variableName} instead of ${variableName}. [Reference].

When you run one of the paragraphs that uses global variables, the global variable input fields will appear above all the paragraphs.



来源:https://stackoverflow.com/questions/40298155/is-it-possible-to-set-global-variables-in-a-zeppelin-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!