Skip to content

Commit 2f5aa5a

Browse files
committed
#7492 document how to deliver jars to executors
1 parent ecb8f13 commit 2f5aa5a

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

doc/scala/SparkUI.ipynb

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"cell_type": "markdown",
4242
"metadata": {},
4343
"source": [
44-
"Optionally, the contents of the cell can produce a Spark session to fill out default values for the GUI. Only one spark magic can be active at a time."
44+
"Optionally, the contents of the cell can produce a Spark session to fill out default values for the GUI. Only one spark magic can be connected at a time."
4545
]
4646
},
4747
{
@@ -73,6 +73,33 @@
7373
"SparkSession.builder().master(\"local[100]\")"
7474
]
7575
},
76+
{
77+
"cell_type": "markdown",
78+
"metadata": {},
79+
"source": [
80+
"If you have added JARs to the classpath of the Spark driver with the `%classpath` magic, they can be copied to the executors as follows. We are looking into making this automatic, and also supporting `spark.jars.packages`, see [#7498](https://github.com/twosigma/beakerx/issues/7498)."
81+
]
82+
},
83+
{
84+
"cell_type": "code",
85+
"execution_count": null,
86+
"metadata": {},
87+
"outputs": [],
88+
"source": [
89+
"%%spark\n",
90+
"val jars = ClasspathManager.getJars().toArray.mkString(\",\")\n",
91+
"SparkSession.builder().config(\"spark.jars\", jars)"
92+
]
93+
},
94+
{
95+
"cell_type": "markdown",
96+
"metadata": {},
97+
"source": [
98+
"After starting a session with a Spark cluster using one of the above configurations,\n",
99+
"then code like the following runs in parallel without any additional annotation.\n",
100+
"A three-way progress widget automatically appears, showing how many tasks are waiting, running, and completed."
101+
]
102+
},
76103
{
77104
"cell_type": "code",
78105
"execution_count": null,
@@ -94,7 +121,7 @@
94121
"cell_type": "markdown",
95122
"metadata": {},
96123
"source": [
97-
"By default the first 1000 rows are materialized to preview a dataset."
124+
"By default the Dataset preview shows just the columns and their types. You can click a button to materialize ten rows."
98125
]
99126
},
100127
{
@@ -122,7 +149,7 @@
122149
"metadata": {},
123150
"outputs": [],
124151
"source": [
125-
"ds.display(1)"
152+
"ds.display(1000)"
126153
]
127154
}
128155
],
@@ -139,6 +166,19 @@
139166
"name": "Scala",
140167
"nbconverter_exporter": "",
141168
"version": "2.11.12"
169+
},
170+
"toc": {
171+
"base_numbering": 1,
172+
"nav_menu": {},
173+
"number_sections": false,
174+
"sideBar": false,
175+
"skip_h1_title": false,
176+
"title_cell": "Table of Contents",
177+
"title_sidebar": "Contents",
178+
"toc_cell": false,
179+
"toc_position": {},
180+
"toc_section_display": false,
181+
"toc_window_display": false
142182
}
143183
},
144184
"nbformat": 4,

0 commit comments

Comments
 (0)