This example shows how Toree enables sharing of the SQLContext across the variety of languages that it supports (Scala, Python, R, SQL). To demostrate, this notebook will load data using one language and read it from another. Refer to the Spark documentation for details about the DataFrame and SQL APIs.
Note
Due to an issue installing R and running it using DockerMachine, we are not able to show an example with R.
In [ ]:
val people = spark.read.json("people.json")
people.createOrReplaceTempView("people")
people.show()
In [ ]:
%%PySpark
people = spark.table("people")
people.show()
In [ ]:
%%PySpark
cars = spark.read.json("cars.json")
cars.createOrReplaceTempView("cars")
cars.show()
In [ ]:
val cars = spark.table("cars")
cars.show()
In [ ]:
%%sql
select * from cars where manufacturer == 'Audi'