cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Can you share variables defined in a Python based cell with Scala cells?

aladda
Honored Contributor II
Honored Contributor II
 
1 ACCEPTED SOLUTION

Accepted Solutions

aladda
Honored Contributor II
Honored Contributor II

Each databricks notebook has an indepedent Scala and Python shell/REPL. Thus variables defined in one can't be shared with the other. However Temp-Views are kept within the Notebook's own spark session and thus can be shared across different language cells and is a common technique to do so

View solution in original post

2 REPLIES 2

aladda
Honored Contributor II
Honored Contributor II

Each databricks notebook has an indepedent Scala and Python shell/REPL. Thus variables defined in one can't be shared with the other. However Temp-Views are kept within the Notebook's own spark session and thus can be shared across different language cells and is a common technique to do so

Imtiyaz_Shaikh
New Contributor II

The workaround is available here.

Idea is to use spark.conf.set(), spark.conf.get() methods.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.