<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Spark-submit</id>
	<title>Spark-submit - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Spark-submit"/>
	<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Spark-submit&amp;action=history"/>
	<updated>2026-12-06T00:13:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://openlakehouse.io/w/index.php?title=Spark-submit&amp;diff=200&amp;oldid=prev</id>
		<title>Open Lakehouse Wiki sync: Sync from open-lakehouse/wiki@7c9abaa</title>
		<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Spark-submit&amp;diff=200&amp;oldid=prev"/>
		<updated>2026-11-25T00:52:58Z</updated>

		<summary type="html">&lt;p&gt;Sync from open-lakehouse/wiki@7c9abaa&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:spark-submit}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                = spark-submit&lt;br /&gt;
| developer           = [[Apache Software Foundation]] ([[Apache Spark]] project)&lt;br /&gt;
| initial_release     = Spark 1.0.0&lt;br /&gt;
| latest_release      = Spark 4.3.0&lt;br /&gt;
| latest_release_date = 2026-10-30&lt;br /&gt;
| written_in          = Shell script, Scala&lt;br /&gt;
| type                = Application launcher for Apache Spark&lt;br /&gt;
| license             = Apache License 2.0&lt;br /&gt;
| website             = [https://spark.apache.org/docs/4.3.0/submitting-applications.html Submitting Applications]&lt;br /&gt;
| repo                = [https://github.com/apache/spark/blob/v4.3.0/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala github.com/apache/spark (core/.../deploy/SparkSubmit.scala)]&lt;br /&gt;
| related             = [[Spark configuration precedence]], [[Spark on YARN]], [[Spark on Kubernetes]], [[Spark standalone cluster manager]]&lt;br /&gt;
}}&lt;br /&gt;
{{Verified|2026-11-23|the v4.3.0 tag of apache/spark (docs/submitting-applications.md, docs/configuration.md, docs/spark-standalone.md, docs/running-on-yarn.md, SparkSubmitArguments.scala and JavaUtils.java), SPARK-48392 and the Spark 1.0.0 release notes}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;spark-submit&amp;#039;&amp;#039;&amp;#039; is the command-line script in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of [[Apache Spark]] that launches a packaged Spark application (a JAR, a Python file or an R file) on a local machine or on any supported cluster manager through one interface.&amp;lt;ref name=&amp;quot;submit&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/submitting-applications.html |title=Submitting Applications (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; It sets up the classpath with Spark and its dependencies, chooses where the driver runs, ships the application&amp;#039;s files to the cluster and passes configuration to the application.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt; The &amp;lt;code&amp;gt;spark-shell&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pyspark&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;spark-sql&amp;lt;/code&amp;gt; shells and the [[Spark Thrift Server]] start script accept the same options.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;thrift&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/sql-distributed-sql-engine.html |title=Distributed SQL Engine (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spark-submit&amp;lt;/code&amp;gt; was introduced in Spark 1.0.0, whose release notes describe it as a new tool for submitting an application to any Spark cluster, including local, [[Apache Mesos support in Spark|Mesos]] and YARN clusters, through a common process.&amp;lt;ref name=&amp;quot;r100&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-1-0-0.html |title=Spark Release 1.0.0 |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How is spark-submit used? ==&lt;br /&gt;
The general form is &amp;lt;code&amp;gt;spark-submit [options] &amp;lt;app jar | python file | R file&amp;gt; [app arguments]&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;ssargs&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala |title=SparkSubmitArguments.scala (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; For a Python application, the &amp;lt;code&amp;gt;.py&amp;lt;/code&amp;gt; file takes the place of the JAR, and extra &amp;lt;code&amp;gt;.py&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.zip&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.egg&amp;lt;/code&amp;gt; files go on the Python path with &amp;lt;code&amp;gt;--py-files&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# A PySpark job on YARN, driver inside the cluster&lt;br /&gt;
./bin/spark-submit \&lt;br /&gt;
  --master yarn \&lt;br /&gt;
  --deploy-mode cluster \&lt;br /&gt;
  --name nightly-etl \&lt;br /&gt;
  --executor-memory 4g \&lt;br /&gt;
  --num-executors 10 \&lt;br /&gt;
  --py-files libs.zip \&lt;br /&gt;
  --conf spark.sql.shuffle.partitions=400 \&lt;br /&gt;
  etl_job.py --date 2026-11-23&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Everything after the application file is passed to the application as its own arguments, so Spark options must come before it.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What are the main arguments? ==&lt;br /&gt;
The following options are listed by &amp;lt;code&amp;gt;spark-submit --help&amp;lt;/code&amp;gt; in Spark 4.3.0.&amp;lt;ref name=&amp;quot;ssargs&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Option !! Meaning !! Default or scope&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--master&amp;lt;/code&amp;gt; || Master URL: &amp;lt;code&amp;gt;local[*]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;spark://host:port&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;yarn&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;k8s://https://host:port&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;local[*]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--deploy-mode&amp;lt;/code&amp;gt; || Run the driver in the submitting process (&amp;lt;code&amp;gt;client&amp;lt;/code&amp;gt;) or on a cluster node (&amp;lt;code&amp;gt;cluster&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;client&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--class&amp;lt;/code&amp;gt; || Main class of a Java or Scala application || Java/Scala only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--name&amp;lt;/code&amp;gt; || Application name ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; || Any Spark property as &amp;lt;code&amp;gt;key=value&amp;lt;/code&amp;gt;; repeat the flag for each property ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--properties-file&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--load-spark-defaults&amp;lt;/code&amp;gt; || Load properties from a file; also load &amp;lt;code&amp;gt;spark-defaults.conf&amp;lt;/code&amp;gt; || see [[Spark configuration precedence]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--jars&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--packages&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--repositories&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--exclude-packages&amp;lt;/code&amp;gt; || JARs, or Maven coordinates resolved with transitive dependencies, for the driver and executor classpaths ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--py-files&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--files&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--archives&amp;lt;/code&amp;gt; || Python dependencies; files and archives placed in each executor&amp;#039;s working directory ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--driver-memory&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--executor-memory&amp;lt;/code&amp;gt; || Driver and executor memory || 1024 MiB and 1 GiB&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--executor-cores&amp;lt;/code&amp;gt; || Cores per executor || 1 on YARN and Kubernetes; all cores of the worker in standalone mode&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--num-executors&amp;lt;/code&amp;gt; || Executors for static allocation || 2; YARN and Kubernetes only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--total-executor-cores&amp;lt;/code&amp;gt; || Total cores for the application || Standalone only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--queue&amp;lt;/code&amp;gt; || YARN queue || &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;; YARN only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--supervise&amp;lt;/code&amp;gt; || Restart the driver if it exits with a non-zero code || Standalone cluster mode only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--kill&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--status&amp;lt;/code&amp;gt; || Kill or query a submitted driver by submission ID || Standalone or Kubernetes cluster mode&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--remote&amp;lt;/code&amp;gt; || [[Spark Connect]] server URL such as &amp;lt;code&amp;gt;sc://host:port&amp;lt;/code&amp;gt;; cannot be combined with &amp;lt;code&amp;gt;--master&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--deploy-mode&amp;lt;/code&amp;gt; || Spark Connect only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--verbose&amp;lt;/code&amp;gt; || Print debug output, including where each configuration value came from ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default driver memory comes from the constant &amp;lt;code&amp;gt;DEFAULT_DRIVER_MEM_MB&amp;lt;/code&amp;gt;, 1024 in Spark 4.3.0.&amp;lt;ref&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/common/utils-java/src/main/java/org/apache/spark/network/util/JavaUtils.java |title=JavaUtils.java (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is the difference between client and cluster deploy mode? ==&lt;br /&gt;
In &amp;#039;&amp;#039;&amp;#039;client&amp;#039;&amp;#039;&amp;#039; mode, the driver runs inside the &amp;lt;code&amp;gt;spark-submit&amp;lt;/code&amp;gt; process, and the application&amp;#039;s input and output are attached to the console. The Spark documentation recommends it when submitting from a gateway machine close to the workers, and for interactive shells.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt; In &amp;#039;&amp;#039;&amp;#039;cluster&amp;#039;&amp;#039;&amp;#039; mode, the driver is launched on a node inside the cluster; the documentation recommends it when submitting from a machine far from the workers, such as a laptop, to reduce network latency between driver and executors.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt; On YARN, cluster mode runs the driver inside the YARN application master, and the client can exit after submission.&amp;lt;ref name=&amp;quot;yarn&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/running-on-yarn.html |title=Running Spark on YARN (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Spark 4.3.0 documentation states that the standalone cluster manager does not support cluster mode for Python applications.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How are dependencies shipped? ==&lt;br /&gt;
The application JAR and any JARs given with &amp;lt;code&amp;gt;--jars&amp;lt;/code&amp;gt; are transferred to the cluster and put on the driver and executor classpaths. &amp;lt;code&amp;gt;--jars&amp;lt;/code&amp;gt; takes a comma-separated list and does not expand directories.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt; Spark uses the URL scheme to decide how to distribute a file: &amp;lt;code&amp;gt;file:&amp;lt;/code&amp;gt; paths are served by the driver&amp;#039;s file server, &amp;lt;code&amp;gt;hdfs:&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;http:&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;https:&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ftp:&amp;lt;/code&amp;gt; are downloaded from the URI, and &amp;lt;code&amp;gt;local:&amp;lt;/code&amp;gt; means the file already exists at that path on every node.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--packages&amp;lt;/code&amp;gt; takes Maven coordinates in the form &amp;lt;code&amp;gt;groupId:artifactId:version&amp;lt;/code&amp;gt; and resolves their transitive dependencies from the local Maven repository, Maven Central and any repositories given with &amp;lt;code&amp;gt;--repositories&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;ssargs&amp;quot; /&amp;gt; For example, a [[Delta Lake]] or [[Apache Iceberg]] runtime can be added this way at launch time instead of being bundled into the application JAR.&lt;br /&gt;
&lt;br /&gt;
== What are common mistakes? ==&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Options after the application file.&amp;#039;&amp;#039;&amp;#039; Arguments after the JAR or &amp;lt;code&amp;gt;.py&amp;lt;/code&amp;gt; file go to the application, not to Spark.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Setting driver memory in code in client mode.&amp;#039;&amp;#039;&amp;#039; In client mode, &amp;lt;code&amp;gt;spark.driver.memory&amp;lt;/code&amp;gt; set on a &amp;lt;code&amp;gt;SparkConf&amp;lt;/code&amp;gt; inside the application has no effect, because the driver JVM is already running; use &amp;lt;code&amp;gt;--driver-memory&amp;lt;/code&amp;gt; or the defaults file.&amp;lt;ref name=&amp;quot;config&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/configuration.html |title=Spark Configuration (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Several properties in one &amp;lt;code&amp;gt;--conf&amp;lt;/code&amp;gt;.&amp;#039;&amp;#039;&amp;#039; Each property needs its own &amp;lt;code&amp;gt;--conf&amp;lt;/code&amp;gt; flag, and a value containing spaces must be quoted as &amp;lt;code&amp;gt;&amp;quot;key=value&amp;quot;&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Local paths in cluster mode.&amp;#039;&amp;#039;&amp;#039; The application JAR URL must be visible from inside the cluster, for example an &amp;lt;code&amp;gt;hdfs://&amp;lt;/code&amp;gt; path or a &amp;lt;code&amp;gt;file://&amp;lt;/code&amp;gt; path present on every node.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Bundling Spark into the application JAR.&amp;#039;&amp;#039;&amp;#039; When building an assembly JAR, Spark and Hadoop should be &amp;lt;code&amp;gt;provided&amp;lt;/code&amp;gt; dependencies, because the cluster supplies them at runtime.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;--properties-file&amp;lt;/code&amp;gt; dropping the defaults.&amp;#039;&amp;#039;&amp;#039; Since Spark 4.0.0 the &amp;lt;code&amp;gt;--load-spark-defaults&amp;lt;/code&amp;gt; flag is needed to keep &amp;lt;code&amp;gt;spark-defaults.conf&amp;lt;/code&amp;gt; when a properties file is given.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&amp;lt;ref&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-48392 |title=SPARK-48392: Load spark-defaults.conf when passing configurations to spark-submit through --properties-file |publisher=Apache Software Foundation JIRA |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Unused JAR copies on standalone workers.&amp;#039;&amp;#039;&amp;#039; Files and JARs are copied to each executor&amp;#039;s working directory; YARN cleans them up automatically, while standalone workers need &amp;lt;code&amp;gt;spark.worker.cleanup.appDataTtl&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Is spark-submit still needed with Spark Connect? ==&lt;br /&gt;
A [[Spark Connect]] client does not need &amp;lt;code&amp;gt;spark-submit&amp;lt;/code&amp;gt;: it connects to a running Spark Connect server with a connection string such as &amp;lt;code&amp;gt;sc://localhost:15002&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;connect&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/spark-connect-overview.html |title=Spark Connect Overview (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; &amp;lt;code&amp;gt;spark-submit&amp;lt;/code&amp;gt; still launches classic applications and the servers themselves; &amp;lt;code&amp;gt;sbin/start-connect-server.sh&amp;lt;/code&amp;gt; starts a Spark Connect server.&amp;lt;ref name=&amp;quot;standalone&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/spark-standalone.html |title=Spark Standalone Mode (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; &amp;lt;code&amp;gt;spark-submit&amp;lt;/code&amp;gt; also has a &amp;lt;code&amp;gt;--remote&amp;lt;/code&amp;gt; option for running an application as a Spark Connect client.&amp;lt;ref name=&amp;quot;ssargs&amp;quot; /&amp;gt; On Kubernetes, the [[Kubernetes Operator for Apache Spark]] submits applications from a &amp;lt;code&amp;gt;SparkApplication&amp;lt;/code&amp;gt; resource instead of a manual &amp;lt;code&amp;gt;spark-submit&amp;lt;/code&amp;gt; call.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Spark configuration precedence]]&lt;br /&gt;
* [[Spark on YARN]]&lt;br /&gt;
* [[Spark on Kubernetes]]&lt;br /&gt;
* [[Spark standalone cluster manager]]&lt;br /&gt;
* [[Kubernetes Operator for Apache Spark]]&lt;br /&gt;
* [[Driver (Apache Spark)]]&lt;br /&gt;
* [[Executor]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Navbox open lakehouse}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Concepts]]&lt;br /&gt;
[[Category:Glossary terms]]&lt;br /&gt;
[[Category:Apache Spark]]&lt;/div&gt;</summary>
		<author><name>Open Lakehouse Wiki sync</name></author>
	</entry>
</feed>