{ "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 :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 }