You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/worker/create_spark_session.rst
+27-5Lines changed: 27 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,32 @@
1
1
.. _worker-create-spark-session:
2
2
3
-
Altering Spark session settings
4
-
===============================
3
+
Configuring Spark session
4
+
=========================
5
5
6
6
SyncMaster Worker creates `SparkSession <https://spark.apache.org/docs/latest/sql-getting-started.html#starting-point-sparksession>`_ for each Run.
7
-
By default, SparkSession is created with ``master=local``, all required .jar packages for specific DB/FileSystem types, and limiter by transfer resources.
8
7
9
-
It is possible to alter SparkSession config by providing custom function:
8
+
By default, SparkSession is created with ``master=local``, including all required .jar packages for DB/FileSystem types, and limited by transfer resources.
9
+
10
+
Custom Spark session configuration
11
+
----------------------------------
12
+
13
+
It is possible to alter default `Spark Session configuration <https://spark.apache.org/docs/latest/configuration.html>`_ worker settings:
14
+
15
+
.. code-block:: yaml
16
+
:caption: config.yml
17
+
18
+
worker:
19
+
spark_session_default_config:
20
+
spark.master: local
21
+
spark.driver.host: 127.0.0.1
22
+
spark.driver.bindAddress: 0.0.0.0
23
+
spark.sql.pyspark.jvmStacktrace.enabled: true
24
+
spark.ui.enabled: false
25
+
26
+
Custom Spark session factory
27
+
----------------------------
28
+
29
+
It is also possible to use custom function which returns ``SparkSession`` object:
10
30
11
31
.. code-block:: yaml
12
32
:caption: config.yml
@@ -21,17 +41,19 @@ Here is a function example:
21
41
22
42
from syncmaster.db.models import Run
23
43
from syncmaster.dto.connections import ConnectionDTO
44
+
from syncmaster.worker.settings import WorkerSettings
0 commit comments