[DRIVERS-711] Deprecate mapparams, out.sharded, and out.nonAtomic arguments to mapReduce Created: 22/Jul/19  Updated: 28/Oct/23  Resolved: 31/Mar/20

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-3365 Deprecate mapparams, out.sharded, and... Closed
depends on CXX-1816 Deprecate mapparams, out.sharded, and... Closed
depends on GODRIVER-1307 Deprecate mapparams, out.sharded, and... Closed
depends on MOTOR-388 Deprecate mapparams, out.sharded, and... Closed
depends on NODE-2160 Deprecate mapparams, out.sharded, and... Closed
depends on PHPLIB-480 Deprecate out.sharded and out.nonAtom... Closed
depends on PYTHON-1980 Deprecate mapparams, out.sharded, and... Closed
depends on RUBY-1930 Deprecate mapparams, out.sharded, and... Closed
depends on SERVER-42134 Deprecate mapparams, out.sharded, and... Closed
depends on CSHARP-2738 Deprecate mapparams, out.sharded, and... Closed
depends on JAVA-3429 Deprecate mapparams, out.sharded, and... Closed
Related
related to DRIVERS-646 MapReduce in Aggregation Closed
related to DRIVERS-726 Deprecate CodeWScope for use within t... Closed
Server Compat: 4.2, 4.3
Driver Compliance:
Key Status/Resolution FixVersion
NODE-2160 Won't Do
JAVA-3429 Fixed 4.1.0
PYTHON-1980 Won't Do
PHPLIB-480 Fixed 1.6.0
CXX-1816 Won't Do
MOTOR-388 Won't Do
CSHARP-2738 Fixed 2.11.0
GODRIVER-1307 Won't Do
RUBY-1930 Won't Do
CDRIVER-3365 Won't Do

 Description   
Epic Summary

Summary

The mapReduce command will be rewritten in server 4.4 to use an agg pipeline under the covers. As a result of that work certain options supported by the existing command will no longer be supported or will change behavior. There is no CRUD spec definition for mapReduce, but multiple drivers provide helpers. Those drivers may have to deprecate the options that will change or no longer be supported in 4.4, or skip tests when connected to a 4.4+ server.

These are the changes from the server scope doc:

  • The following will be ignored in 4.4
    • jsMode: Specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions. There will be no option to maintain intermediate objects as JavaScript objects.
    • out.nonAtomic with a value of true: MapReduce will no longer hold either MODE_X database or global write locks for the duration of write to an output collection. This is in line with the previous nonAtomic: true behavior.
  • The following will be rejected in 4.4 and deprecated in 4.2
    • out.nonAtomic with a value of false: MapReduce will no longer hold either MODE_X database or global write locks for the duration of write to an output collection.
    • out.sharded with a value of false. In the legacy implementation specifying this has the same behavior as omitting the out.sharded option.
    • out.sharded with a value of true, when the output collection does not already exist as a sharded collection
      For the legacy implementation, On output to a non-existent collection will shard that collection with the _id field as shard key. In the new implementation iIf users require a sharded output collection, they will have to create/shard prior to executing mapReduce.
      This option is currently required to output to a sharded collection even if the collection exists. In order to support mapReduce to a sharded collection during upgrade, we will allow but ignore out.sharded:true with MR in aggregation.
    • mapparams: Takes an array and passes each element as an argument to the map function. This parameter is undocumented and we believe does not serve a purpose given the ability to provide constants via "scope" argument.
    • User-defined functions (map, reduce, finalize) as CodeWScope


 Comments   
Comment by Rathi Gnanasekaran [ 19/Aug/19 ]

Maybe relevant for drivers that have mapReduce helper and model these options.

Generated at Thu Feb 08 08:22:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.