<?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=Scala_2.12_and_2.13_in_Spark</id>
	<title>Scala 2.12 and 2.13 in Spark - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Scala_2.12_and_2.13_in_Spark"/>
	<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Scala_2.12_and_2.13_in_Spark&amp;action=history"/>
	<updated>2026-12-06T00:08:56Z</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=Scala_2.12_and_2.13_in_Spark&amp;diff=103&amp;oldid=prev</id>
		<title>Open Lakehouse Wiki sync: Sync from open-lakehouse/wiki@f2492a3</title>
		<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Scala_2.12_and_2.13_in_Spark&amp;diff=103&amp;oldid=prev"/>
		<updated>2026-11-23T00:34:54Z</updated>

		<summary type="html">&lt;p&gt;Sync from open-lakehouse/wiki@f2492a3&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox concept&lt;br /&gt;
| name            = Scala 2.12 and 2.13 in Spark&lt;br /&gt;
| also_known_as   = Scala binary version; Scala cross-build&lt;br /&gt;
| field           = Build and dependency management&lt;br /&gt;
| introduced      = Scala 2.12 builds in Spark 2.4.0; Scala 2.13 builds in Spark 3.2.0&lt;br /&gt;
| key_parts       = Scala binary version, artifact suffix (&amp;lt;code&amp;gt;_2.12&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_2.13&amp;lt;/code&amp;gt;), Maven profiles&lt;br /&gt;
| implementations = [[Apache Spark]]&lt;br /&gt;
| related         = [[Apache Iceberg]], [[Delta Lake]], [[Spark Connect]]&lt;br /&gt;
}}&lt;br /&gt;
{{Verified|2026-11-22|pom.xml at the v2.4.0, v3.0.0, v3.2.0, v3.5.0, v4.0.0 and v4.3.0 tags of apache/spark, docs/index.md and docs/building-spark.md at v3.5.0 and v4.3.0, the Spark 3.2.0, 3.5.0 and 4.0.0 release notes, SPARK-14220, SPARK-26132, SPARK-25075, SPARK-34218, SPARK-43836 and SPARK-45314, gradle.properties at apache-iceberg-1.12.0, and the Scala binary compatibility documentation}}&lt;br /&gt;
{{Status|removed |removed=Apache Spark 4.0.0 |replacement=Scala 2.13 |note=This status is for Scala 2.12 support. Spark 3.5.0 announced the removal, and from Spark 4.0.0 Scala 2.13 is the only Scala version Spark is built for. |ref=&amp;lt;ref name=&amp;quot;s45314&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-45314 |title=SPARK-45314: Drop Scala 2.12 and make Scala 2.13 by default |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Scala 2.12 and 2.13 in Spark&amp;#039;&amp;#039;&amp;#039; refers to the two Scala versions that [[Apache Spark]] was built for during the Spark 3 series, and to the requirement that Scala and Java applications, libraries and connectors use the same Scala version as the Spark build they run on.&amp;lt;ref name=&amp;quot;index43&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/docs/index.md |title=Overview (docs/index.md at v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; Spark 3.2.0 to 3.5.x published artifacts for both Scala 2.12 and 2.13, with 2.12 as the default build. Spark 4.0.0 removed Scala 2.12, so every Spark 4 release is built only for Scala 2.13.&amp;lt;ref name=&amp;quot;s45314&amp;quot; /&amp;gt; The version shows up in artifact names such as &amp;lt;code&amp;gt;spark-sql_2.13&amp;lt;/code&amp;gt;, and it has to match for every jar that contains Scala code, including connectors and table format runtimes.&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
Scala 2.12 support was removed in Spark 4.0.0 by SPARK-45314, &amp;quot;Drop Scala 2.12 and make Scala 2.13 by default&amp;quot;.&amp;lt;ref name=&amp;quot;s45314&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;r400&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-4-0-0.html |title=Spark Release 4.0.0 |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; The Spark 3.5.0 release notes had announced it in an &amp;quot;Upcoming Removal&amp;quot; section, which said that support for Scala 2.12 would be removed in the next major release and that the minimum Scala version would be 2.13.&amp;lt;ref name=&amp;quot;r350&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-3-5-0.html |title=Spark Release 3.5.0 |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; An earlier proposal to make 2.13 the default already in Spark 3.5 (SPARK-43836) was closed as Won&amp;#039;t Do.&amp;lt;ref name=&amp;quot;s43836&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-43836 |title=SPARK-43836: Make Scala 2.13 as default Scala version in Spark 3.5 |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the v4.3.0 tag, the root &amp;lt;code&amp;gt;pom.xml&amp;lt;/code&amp;gt; sets Scala 2.13.18 with binary version 2.13 and defines only a &amp;lt;code&amp;gt;scala-2.13&amp;lt;/code&amp;gt; profile; there is no Scala 2.12 or Scala 3 build.&amp;lt;ref name=&amp;quot;pom430&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/pom.xml |title=pom.xml (Apache Spark v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; The Spark 4.3.0 documentation says that Spark runs on Scala 2.13 and that applications using the Scala API must use the Scala version Spark was compiled for, which since Spark 4.0.0 is 2.13.&amp;lt;ref name=&amp;quot;index43&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Spark release !! Default Scala build !! Other Scala build !! Change&lt;br /&gt;
|-&lt;br /&gt;
| 2.4.0 || 2.11 || 2.12 || Scala 2.12 build added (SPARK-14220)&amp;lt;ref name=&amp;quot;s14220&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-14220 |title=SPARK-14220: Build and test Spark against Scala 2.12 |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;pom240&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v2.4.0/pom.xml |title=pom.xml (Apache Spark v2.4.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3.0.0 || 2.12 || None published (2.13 artifacts came in 3.2.0) || Scala 2.11 removed (SPARK-26132)&amp;lt;ref name=&amp;quot;s26132&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-26132 |title=SPARK-26132: Remove support for Scala 2.11 in Spark 3.0.0 |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3.2.0 || 2.12 || 2.13 || Scala 2.13 build and published artifacts (SPARK-25075, SPARK-34218)&amp;lt;ref name=&amp;quot;s25075&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-25075 |title=SPARK-25075: Build and test Spark against Scala 2.13 |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;r320&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-3-2-0.html |title=Spark Release 3.2.0 |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3.5.0 || 2.12 || 2.13 || Removal of 2.12 announced for the next major release&amp;lt;ref name=&amp;quot;r350&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4.0.0 || 2.13 || None || Scala 2.12 removed (SPARK-45314)&amp;lt;ref name=&amp;quot;s45314&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4.3.0 || 2.13 || None || No change; Scala 2.13.18&amp;lt;ref name=&amp;quot;pom430&amp;quot; /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the Spark 3 series the 2.13 build was an alternative, not the default. The Spark 3.5.0 build documentation lists Scala 2.12 and 2.13 as supported and explains that switching requires &amp;lt;code&amp;gt;./dev/change-scala-version.sh 2.13&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;scala-2.13&amp;lt;/code&amp;gt; Maven or sbt profile.&amp;lt;ref name=&amp;quot;build350&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v3.5.0/docs/building-spark.md |title=Building Spark (docs/building-spark.md at v3.5.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;pom350&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v3.5.0/pom.xml |title=pom.xml (Apache Spark v3.5.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Why the Scala version matters ==&lt;br /&gt;
Scala&amp;#039;s binary compatibility guarantee covers releases within one series, such as 2.13.x, and not across series, so code compiled for Scala 2.12 is not guaranteed to run with the Scala 2.13 library.&amp;lt;ref name=&amp;quot;scalabc&amp;quot;&amp;gt;{{Cite web |url=https://docs.scala-lang.org/overviews/core/binary-compatibility-of-scala-releases.html |title=Binary Compatibility of Scala Releases |publisher=Scala Center / EPFL |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; For that reason Scala libraries are published once per Scala binary version, with the version appended to the artifact name, and Spark follows the same convention: &amp;lt;code&amp;gt;spark-core_2.12&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;spark-core_2.13&amp;lt;/code&amp;gt; are separate artifacts.&amp;lt;ref name=&amp;quot;pom350&amp;quot; /&amp;gt; The Spark 3.5.0 documentation gives the rule directly: when using Scala 2.13, use Spark compiled for 2.13 and compile applications for 2.13 as well.&amp;lt;ref name=&amp;quot;index350&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v3.5.0/docs/index.md |title=Overview (docs/index.md at v3.5.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule reaches beyond user code. Connector and table format jars that contain Scala code are built per Scala version too. For example, the [[Apache Iceberg]] documentation lists Spark runtime jars such as &amp;lt;code&amp;gt;iceberg-spark-runtime-3.5_2.12&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;iceberg-spark-runtime-3.5_2.13&amp;lt;/code&amp;gt;, where the first number is the Spark version and the suffix is the Scala version; at apache-iceberg-1.12.0 the build knows Scala 2.12 and 2.13 and Spark 3.5, 4.0, 4.1 and 4.2.&amp;lt;ref name=&amp;quot;icegradle&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/iceberg/blob/apache-iceberg-1.12.0/gradle.properties |title=gradle.properties (apache-iceberg-1.12.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; Adding a &amp;lt;code&amp;gt;_2.12&amp;lt;/code&amp;gt; connector to a Spark 4 cluster is a mismatch, because no Spark 4 build uses Scala 2.12.&lt;br /&gt;
&lt;br /&gt;
Python users of PySpark and clients of [[Spark Connect]] do not compile against Spark&amp;#039;s Scala classes, so the Scala version is mostly invisible to them. It still matters when they add JVM packages to the server or session, for example with &amp;lt;code&amp;gt;--packages&amp;lt;/code&amp;gt;, because those jars load into the Scala 2.13 JVM.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
A Maven dependency for Spark SQL 4.3.0 names the Scala binary version in the artifact ID:&amp;lt;ref name=&amp;quot;pom430&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;dependency&amp;gt;&lt;br /&gt;
  &amp;lt;groupId&amp;gt;org.apache.spark&amp;lt;/groupId&amp;gt;&lt;br /&gt;
  &amp;lt;artifactId&amp;gt;spark-sql_2.13&amp;lt;/artifactId&amp;gt;&lt;br /&gt;
  &amp;lt;version&amp;gt;4.3.0&amp;lt;/version&amp;gt;&lt;br /&gt;
  &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;
&amp;lt;/dependency&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equivalent sbt line is &amp;lt;code&amp;gt;&amp;quot;org.apache.spark&amp;quot; %% &amp;quot;spark-sql&amp;quot; % &amp;quot;4.3.0&amp;quot; % &amp;quot;provided&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;scalaVersion&amp;lt;/code&amp;gt; set to a 2.13 release; the &amp;lt;code&amp;gt;%%&amp;lt;/code&amp;gt; operator appends the project&amp;#039;s Scala binary version to the artifact name.&amp;lt;ref name=&amp;quot;sbt&amp;quot;&amp;gt;{{Cite web |url=https://www.scala-sbt.org/1.x/docs/Library-Dependencies.html |title=Library Dependencies |publisher=sbt |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Apache Spark]]&lt;br /&gt;
* [[Spark Connect]]&lt;br /&gt;
* [[Apache Iceberg]]&lt;br /&gt;
* [[Delta Lake]]&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>