Skip to content

Commit 7d9ce60

Browse files
DOCS-12790 (#32)
* DOCS-12790 - Spark 2.4.1 release notes and updates. * DOCS-12790 - A few more edits. * DOCS-12790 - Update landing page.
1 parent 578336e commit 7d9ce60

File tree

9 files changed

+53
-14
lines changed

9 files changed

+53
-14
lines changed

conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
}
6363

6464
source_constants = {
65-
'current-version': '2.4.0',
66-
'spark-core-version': '2.4.0',
67-
'spark-sql-version': '2.4.0'
65+
'current-version': '2.4.1',
66+
'spark-core-version': '2.4.1',
67+
'spark-sql-version': '2.4.1'
6868
}
6969

7070
intersphinx_mapping = {}

source/configuration.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ The following options for reading from MongoDB are available:
9696

9797
- Required. The collection name from which to read data.
9898

99+
* - ``batchSize``
100+
101+
- Size of the internal batches used within the cursor.
102+
99103
* - ``localThreshold``
100104

101105
- The threshold (in milliseconds) for choosing a server from
@@ -449,6 +453,12 @@ The following options for writing to MongoDB are available:
449453

450454
- Required. The collection name to write data to
451455

456+
* - ``extendedBsonTypes``
457+
458+
- Enables extended BSON types when writing data to MongoDB.
459+
460+
*Default*: ``true``
461+
452462
* - ``localThreshold``
453463

454464
- The threshold (milliseconds) for choosing a server from multiple
@@ -555,7 +565,7 @@ share the MongoClient across threads.
555565
* - System Property name
556566
- Description
557567

558-
* - ``spark.mongodb.keep_alive_ms``
559-
- The length of time to keep a MongoClient available for sharing.
568+
* - ``mongodb.keep_alive_ms``
569+
- The length of time to keep a ``MongoClient`` available for sharing.
560570

561571
*Default*: 5000

source/index.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ versions of Apache Spark and MongoDB:
5353

5454
.. admonition:: Announcements
5555

56+
- **Jun 06, 2019**, `MongoDB Connector for Spark versions v2.4.1,
57+
v2.3.3, v2.2.7, and v2.1.6
58+
<https://www.mongodb.com/products/spark-connector>`_ Released.
59+
5660
- **Dec 07, 2018**, `MongoDB Connector for Spark versions v2.4.0,
5761
v2.3.2, v2.2.6, and v2.1.5
5862
<https://www.mongodb.com/products/spark-connector>`_ Released.

source/python/aggregation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ to use when creating a DataFrame.
2323
.. code-block:: none
2424

2525
pipeline = "{'$match': {'type': 'apple'}}"
26-
df = spark.read.format("com.mongodb.spark.sql.DefaultSource").option("pipeline", pipeline).load()
26+
df = spark.read.format("mongo").option("pipeline", pipeline).load()
2727
df.show()
2828

2929
In the ``pyspark`` shell, the operation prints the following output:

source/python/filters-and-sql.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ source:
2929

3030
.. code-block:: python
3131

32-
df = spark.read.format("com.mongodb.spark.sql.DefaultSource").load()
32+
df = spark.read.format("mongo").load()
3333

3434
The following example includes only
3535
records in which the ``qty`` field is greater than or equal to ``10``.

source/python/read-from-mongodb.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ from within the ``pyspark`` shell.
2222

2323
.. code-block:: python
2424

25-
df = spark.read.format("com.mongodb.spark.sql.DefaultSource").load()
25+
df = spark.read.format("mongo").load()
2626

2727
Spark samples the records to infer the schema of the collection.
2828

@@ -47,5 +47,5 @@ To read from a collection called ``contacts`` in a database called
4747

4848
.. code-block:: python
4949

50-
df = spark.read.format("com.mongodb.spark.sql.DefaultSource").option("uri",
50+
df = spark.read.format("mongo").option("uri",
5151
"mongodb://127.0.0.1/people.contacts").load()

source/python/write-to-mongodb.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ by using the ``write`` method:
2828

2929
.. code-block:: python
3030

31-
people.write.format("com.mongodb.spark.sql.DefaultSource").mode("append").save()
31+
people.write.format("mongo").mode("append").save()
3232

3333
The above operation writes to the MongoDB database and collection
3434
specified in the :ref:`spark.mongodb.output.uri<pyspark-shell>` option
@@ -83,5 +83,5 @@ To write to a collection called ``contacts`` in a database called
8383

8484
.. code-block:: python
8585

86-
people.write.format("com.mongodb.spark.sql.DefaultSource").mode("append").option("database",
86+
people.write.format("mongo").mode("append").option("database",
8787
"people").option("collection", "contacts").save()

source/release-notes.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@ Release Notes
44

55
.. default-domain:: mongodb
66

7+
MongoDB Connector for Spark `2.4.1`_
8+
------------------------------------
9+
10+
*Released on June 6, 2019*
11+
12+
- Ensures nullable fields or container types accept ``null`` values.
13+
- Added ``ReadConfig.batchSize`` property. For more information, see
14+
:ref:`spark-input-conf`.
15+
- Renamed system property ``spark.mongodb.keep_alive_ms`` to
16+
``mongodb.keep_alive_ms``.
17+
- Added ``MongoDriverInformation`` to the default ``MongoClient``.
18+
- Updated to latest Java driver (3.10.+)
19+
- Updated ``PartitionerHelper.matchQuery`` to no longer include ``$ne``/``$exists``
20+
checks.
21+
- Added logging support for partitioners and their queries.
22+
- Added ``WriteConfig.extendedBsonTypes`` setting so users can disable
23+
extended BSON types when writing. For more information, see
24+
:ref:`spark-output-conf`.
25+
- Added Java spi can now use short form: ``spark.read.format("mongo")``.
26+
- ``spark.read.format("mongo")`` can be used in place of
27+
``spark.read.format("com.mongodb.spark.sql")`` and
28+
``spark.read.format("com.mongodb.spark.sql.DefaultSource")``.
29+
30+
.. _2.4.1: https://github.com/mongodb/mongo-spark/compare/2.4.0...r2.4.1
31+
732
MongoDB Connector for Spark `2.4.0`_
833
------------------------------------
934

source/scala/datasets-and-sql.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ Alternatively, you can use ``SparkSession`` methods to create DataFrames:
103103
) // ReadConfig used for configuration
104104

105105
val df4 = sparkSession.read.mongo() // SparkSession used for configuration
106-
sqlContext.read.format("com.mongodb.spark.sql").load()
106+
sqlContext.read.format("mongo").load()
107107

108108
// Set custom options
109109
import com.mongodb.spark.config._
110110

111111
val customReadConfig = ReadConfig(Map("readPreference.name" -> "secondaryPreferred"), Some(ReadConfig(sc)))
112112
val df5 = sparkSession.read.mongo(customReadConfig)
113113

114-
val df6 = sparkSession.read.format("com.mongodb.spark.sql").options(customReadConfig.asOptions).load()
114+
val df6 = sparkSession.read.format("mongo").options(customReadConfig.asOptions).load()
115115

116116
.. _scala-dataset-filters:
117117

@@ -260,7 +260,7 @@ to MongoDB using the DataFrameWriter directly:
260260
.. code-block:: scala
261261

262262
centenarians.write.option("collection", "hundredClub").mode("overwrite").mongo()
263-
centenarians.write.option("collection", "hundredClub").mode("overwrite").format("com.mongodb.spark.sql").save()
263+
centenarians.write.option("collection", "hundredClub").mode("overwrite").format("mongo").save()
264264

265265
DataTypes
266266
---------

0 commit comments

Comments
 (0)