You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by "Balachandar R.A." <ba...@gmail.com> on 2016/11/14 11:15:12 UTC

Share variable across notebooks

Hello,

Is there a way to spread my paragraphs into two different notebooks?  In
other words, how to share a variable (spark RDD / spark dataframe /
javascript variable)  across multiple notebooks?

Regards
Bala

Re: Share variable across notebooks

Posted by Sora Lee <so...@nflabs.com>.
Hi, bala,

Thanks for sharing the problem.

For the more information, If you want to change the sharing option of the
variable, you can use option of each interpreter in Interpreter menu.

[image: pasted1]

Thanks,
Sora



On Mon, Nov 14, 2016 at 2:31 PM Jun Kim <i2...@gmail.com> wrote:

> Hi Balachandar
>
> You can share a variable of Spark as default. Try creating a variable and
> using it from another note.
>
> However, it's not a good thought to share variables in my experience.
>
> There is a possibility of a conflict of variables, and you won't figure
> out where the variable comes from in the future.
>
> Above all, it creates a dependency between notes. What it means is you
> should run other notes before running a note you want!
>
> I recommend you to turn off variable sharing from interpreter setting.
>
> Finish use of a variable where it was created, and if you need to share
> some data between notes, use HDFS or local FS.
>
> Jun
>
> 2016년 11월 14일 (월) 오후 8:15, Balachandar R.A. <ba...@gmail.com>님이
> 작성:
>
> Hello,
>
> Is there a way to spread my paragraphs into two different notebooks?  In
> other words, how to share a variable (spark RDD / spark dataframe /
> javascript variable)  across multiple notebooks?
>
> Regards
> Bala
>
> --
> Taejun Kim
>
> Data Mining Lab.
> School of Electrical and Computer Engineering
> University of Seoul
>

Re: Share variable across notebooks

Posted by Jun Kim <i2...@gmail.com>.
Hi Balachandar

You can share a variable of Spark as default. Try creating a variable and
using it from another note.

However, it's not a good thought to share variables in my experience.

There is a possibility of a conflict of variables, and you won't figure out
where the variable comes from in the future.

Above all, it creates a dependency between notes. What it means is you
should run other notes before running a note you want!

I recommend you to turn off variable sharing from interpreter setting.

Finish use of a variable where it was created, and if you need to share
some data between notes, use HDFS or local FS.

Jun

2016년 11월 14일 (월) 오후 8:15, Balachandar R.A. <ba...@gmail.com>님이 작성:

> Hello,
>
> Is there a way to spread my paragraphs into two different notebooks?  In
> other words, how to share a variable (spark RDD / spark dataframe /
> javascript variable)  across multiple notebooks?
>
> Regards
> Bala
>
-- 
Taejun Kim

Data Mining Lab.
School of Electrical and Computer Engineering
University of Seoul

Re: Share variable across notebooks

Posted by DuyHai Doan <do...@gmail.com>.
You can share variables using ResourcePool:

Put a variable
-
https://github.com/apache/zeppelin/blob/master/spark/src/main/java/org/apache/zeppelin/spark/ZeppelinContext.java#L809-L812

Get a variable
-
https://github.com/apache/zeppelin/blob/master/spark/src/main/java/org/apache/zeppelin/spark/ZeppelinContext.java#L814-L829

The resource pool is shared across notes & paragraphs

On Mon, Nov 14, 2016 at 12:15 PM, Balachandar R.A. <balachandar.ra@gmail.com
> wrote:

> Hello,
>
> Is there a way to spread my paragraphs into two different notebooks?  In
> other words, how to share a variable (spark RDD / spark dataframe /
> javascript variable)  across multiple notebooks?
>
> Regards
> Bala
>