Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2021 03:44 AM
Variables are not shared between language contexts.
Ugly workaround: you could do something like this to pass your python variable to the spark context:
%python
d1 = {1: "a", 2:"b", 3:"c"}
spark.conf.set('d1', str(d1))%scala
println( spark.conf.get("d1") )However, you lose variable type. You only can pass on strings.