Support Questions

Find answers, ask questions, and share your expertise

Global Variables in Zeppelin Notebook

Hi Team,

Is there any way I can define global variable in Zeppelin notebook in a paragraph which then could drive other paragraphs like how we do in jupyter notes for Spark/Python?

If yes, can someone share sample example?

I'm using Zeppelin Version 0.7.0 and Spark2.

Any help is highly appreciated and thanks in advance.

1 ACCEPTED SOLUTION

@Sridhar Reddy

Since Spark2 interpreter is in globally shared mode, there is only one Spark2 session (i.e. Spark2 context) shared between all users and all notebooks in zeppelin. A variable defined in one paragraph of one notebook maybe accessed freely in other paragraphs of the same notebook, and for that matter paragraphs of other notebooks as well.

Attaching screenshots

screen-shot-2018-01-25-at-14317-pm.png

screen-shot-2018-01-25-at-14344-pm.png

View solution in original post

1 REPLY 1

@Sridhar Reddy

Since Spark2 interpreter is in globally shared mode, there is only one Spark2 session (i.e. Spark2 context) shared between all users and all notebooks in zeppelin. A variable defined in one paragraph of one notebook maybe accessed freely in other paragraphs of the same notebook, and for that matter paragraphs of other notebooks as well.

Attaching screenshots

screen-shot-2018-01-25-at-14317-pm.png

screen-shot-2018-01-25-at-14344-pm.png