@@ -5,24 +5,40 @@ Dependency Management
5
5
6
6
.. include:: /includes/scala-java-dependencies.rst
7
7
8
- The following excerpt is from a Maven ``pom.xml`` file:
8
+ Beginning in version 3.2.0, Apache Spark supports both Scala {+scala-previous+} and {+scala-latest+}.
9
+ Spark 3.1.3 and previous versions support only Scala {+scala-previous+}.
10
+ To provide support for both Scala versions, version {+current-version+} of the Spark
11
+ Connector produces two artifacts:
12
+
13
+ - ``org.mongodb.spark:mongo-spark-connector_{+scala-previous+}:{+current-version+}`` is
14
+ compiled against Scala {+scala-previous+}, and supports Spark 3.1.x and above.
15
+ - ``org.mongodb.spark:mongo-spark-connector_{+scala-latest+}:{+current-version+}`` is
16
+ compiled against Scala {+scala-latest+}, and supports Spark 3.2.x and above.
17
+
18
+ .. important::
19
+
20
+ Use the Spark Connector artifact that's compatible with your
21
+ versions of Scala and Spark.
22
+
23
+ The following excerpt from a Maven ``pom.xml`` file shows how to include dependencies
24
+ compatible with Scala {+scala-previous+}:
9
25
10
26
.. code-block:: xml
11
27
12
28
<dependencies>
13
29
<dependency>
14
30
<groupId>org.mongodb.spark</groupId>
15
- <artifactId>mongo-spark-connector </artifactId>
31
+ <artifactId>mongo-spark-connector_{+scala-previous+} </artifactId>
16
32
<version>{+current-version+}</version>
17
33
</dependency>
18
34
<dependency>
19
35
<groupId>org.apache.spark</groupId>
20
- <artifactId>spark-core_{+scala-version +}</artifactId>
36
+ <artifactId>spark-core_{+scala-previous +}</artifactId>
21
37
<version>{+spark-core-version+}</version>
22
38
</dependency>
23
39
<dependency>
24
40
<groupId>org.apache.spark</groupId>
25
- <artifactId>spark-sql_{+scala-version +}</artifactId>
41
+ <artifactId>spark-sql_{+scala-previous +}</artifactId>
26
42
<version>{+spark-sql-version+}</version>
27
43
</dependency>
28
44
</dependencies>
0 commit comments