mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-08 02:24:04 +00:00

* Test added for all kernels * Same examples as provided in the documentation (`specifics.md`) * Used the same use case for all examples: sum of the first 100 whole numbers Note: I've not automatically tested `local_sparklyr.ipynb` since it creates by default the `metastore_db` dir and the `derby.log` file in the working directory. Since I mount it in `RO` it's not working. I'm struggling to set it elsewhere...
89 lines
1.6 KiB
Plaintext
89 lines
1.6 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"Waiting for a Spark session to start..."
|
|
]
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
},
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"spark://master:7077\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"// should print the value of --master in the kernel spec\n",
|
|
"println(sc.master)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"Waiting for a Spark session to start..."
|
|
]
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
},
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"rdd = ParallelCollectionRDD[0] at parallelize at <console>:28\n"
|
|
]
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
},
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"5050.0"
|
|
]
|
|
},
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"// Sum of the first 100 whole numbers\n",
|
|
"val rdd = sc.parallelize(0 to 100)\n",
|
|
"rdd.sum()\n",
|
|
"// 5050"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Apache Toree - Scala",
|
|
"language": "scala",
|
|
"name": "apache_toree_scala"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": "text/x-scala",
|
|
"file_extension": ".scala",
|
|
"mimetype": "text/x-scala",
|
|
"name": "scala",
|
|
"pygments_lexer": "scala",
|
|
"version": "2.11.12"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 4
|
|
} |