Support Questions

Find answers, ask questions, and share your expertise

Variables and functions declared in one notebook are accessible in another notebook Zeppelin, why?

avatar
Explorer

Dear All,

I am new not Zeppelin notebook, I have come across some strange behavior.

1. The variables and functions declared one notebook, can be accessible from another notebook.

a. Why this feature is available ?

b. How avoid this feature if possible ?

c.How to clear the variables and the functions from the memory ?

1 ACCEPTED SOLUTION

avatar

@shivanand khobanna Are you defining those variables with %spark interpreter ? In that case, the default mode of %spark interpreter is 'Globally Shared'

19457-screen-shot-2017-07-13-at-94908-am.png

In Shared mode, single JVM process and single Interpreter Group serves all Notes. Hence you might see variables defined in one note available to all users and all notebooks. So the behavior you are seeing is by design. You can change your interpreter modes through interpreters page. But better use 'livy' interpreter which uses 'Per user scoped' mode by default on HDP installed zeppelin. That means that you will see different YARN APPs for each user who is trying to use %livy interpreter and hence different spark context for each user which disables the sharing of namespace variables defined by one user from the other user.

Please checkout this article for more info on various zeppelin interpreter modes and what each of the modes means:

https://medium.com/@leemoonsoo/apache-zeppelin-interpreter-mode-explained-bae0525d0555

View solution in original post

1 REPLY 1

avatar

@shivanand khobanna Are you defining those variables with %spark interpreter ? In that case, the default mode of %spark interpreter is 'Globally Shared'

19457-screen-shot-2017-07-13-at-94908-am.png

In Shared mode, single JVM process and single Interpreter Group serves all Notes. Hence you might see variables defined in one note available to all users and all notebooks. So the behavior you are seeing is by design. You can change your interpreter modes through interpreters page. But better use 'livy' interpreter which uses 'Per user scoped' mode by default on HDP installed zeppelin. That means that you will see different YARN APPs for each user who is trying to use %livy interpreter and hence different spark context for each user which disables the sharing of namespace variables defined by one user from the other user.

Please checkout this article for more info on various zeppelin interpreter modes and what each of the modes means:

https://medium.com/@leemoonsoo/apache-zeppelin-interpreter-mode-explained-bae0525d0555