<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:59:53 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-2409] Error attempting to use &quot;reduce&quot; MapReduce Output Mode</title>
                <link>https://jira.mongodb.org/browse/SERVER-2409</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I&apos;m running a series of tests (See casbah-core/src/test/scala/MapReduceSpec.scala in Casbah for some of the test routines I&apos;m running) and unable to successfully run a MapReduce with a &apos;reduce&apos; output.&lt;/p&gt;

&lt;p&gt;&apos;merge&apos; works fine.&lt;/p&gt;

&lt;p&gt;I&apos;m attempting to create a &quot;final&quot; map_reduce collection by having multiple MapReduce jobs on different identical datasets run with &apos;reduce&apos; output.&lt;/p&gt;

&lt;p&gt;The collections I&apos;m reading from are &apos;yield_historical.out.nineties&apos; and &apos;yield_historical.out.aughts&apos;.  They contain data like such:&lt;/p&gt;

&lt;p&gt;{ &quot;_id&quot; : 100, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 231, &quot;sum&quot; : 1380.3799999999985 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 101, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 248, &quot;sum&quot; : 1245.1300000000003 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 102, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 250, &quot;sum&quot; : 1153.27 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 103, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 250, &quot;sum&quot; : 1003.4699999999997 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 104, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 250, &quot;sum&quot; : 1067.8300000000008 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 105, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 250, &quot;sum&quot; : 1072.2200000000003 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 106, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 250, &quot;sum&quot; : 1198.7499999999989 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 107, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 251, &quot;sum&quot; : 1163.3000000000002 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 108, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 251, &quot;sum&quot; : 919.73 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 109, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 250, &quot;sum&quot; : 816.0300000000009 }
&lt;p&gt; }&lt;br/&gt;
{ &quot;_id&quot; : 110, &quot;value&quot; : &lt;/p&gt;
{ &quot;count&quot; : 189, &quot;sum&quot; : 628.5199999999996 }
&lt;p&gt; }&lt;/p&gt;

&lt;p&gt;These collections were produced by running a normal mapReduce job with the same Map and Reduce function.&lt;/p&gt;

&lt;p&gt;When I attempt to run the job however, I get the error:&lt;/p&gt;

{ &quot;assertion&quot; : &quot;Not an index cursor&quot; , &quot;assertionCode&quot; : 9011 , &quot;errmsg&quot; : &quot;db assertion failure&quot; , &quot;ok&quot; : 0.0}

&lt;p&gt;The command being run is:&lt;/p&gt;

&lt;p&gt;{ &quot;mapreduce&quot; : &quot;yield_historical.out.aughts&quot; , &lt;br/&gt;
  &quot;map&quot; : &quot;function m() {  emit( typeof(this._id) == \&quot;number\&quot; ? this._id : this._id.getYear(), &lt;/p&gt;
{ count: 1, sum: this.bc10Year }
&lt;p&gt;)  }&quot; , &lt;br/&gt;
  &quot;reduce&quot; : &quot;      function r( year, values ) {&lt;br/&gt;
          var n = &lt;/p&gt;
{ count: 0,  sum: 0 }
&lt;p&gt;          for ( var i = 0; i &amp;lt; values.length; i++ )&lt;/p&gt;
{ 
              n.sum += values[i].sum;
              n.count += values[i].count;
          }

&lt;p&gt;          return n;&lt;br/&gt;
      }&quot;,&lt;br/&gt;
  &quot;verbose&quot; : true , &quot;out&quot; : &lt;/p&gt;
{ &quot;reduce&quot; : &quot;yield_historical.out.all&quot;}
&lt;p&gt;}&lt;/p&gt;
</description>
                <environment>1.7.4, 64 bit Mac OS X with Durability enabled</environment>
        <key id="14309">SERVER-2409</key>
            <summary>Error attempting to use &quot;reduce&quot; MapReduce Output Mode</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="brendan">Brendan W. McAdams</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 Jan 2011 21:09:51 +0000</created>
                <updated>Tue, 12 Jul 2016 00:17:46 +0000</updated>
                            <resolved>Wed, 26 Jan 2011 00:40:19 +0000</resolved>
                                    <version>1.7.4</version>
                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="22687" author="brendan" created="Tue, 25 Jan 2011 23:42:11 +0000"  >&lt;p&gt;Works against MASTER, no error reported.&lt;/p&gt;</comment>
                            <comment id="22685" author="eliot" created="Tue, 25 Jan 2011 22:39:53 +0000"  >&lt;p&gt;Can you try with HEAD&lt;/p&gt;</comment>
                            <comment id="22683" author="brendan" created="Tue, 25 Jan 2011 22:10:47 +0000"  >&lt;p&gt;Attached a test JS file and the source data I was using.&lt;/p&gt;

&lt;p&gt;It looks like the issue may be trying to reduce into a collection which doesn&apos;t already exist.&lt;/p&gt;</comment>
                            <comment id="22682" author="brendan" created="Tue, 25 Jan 2011 22:10:12 +0000"  >&lt;p&gt;These JavaScript files can be used to reproduce the issue.&lt;/p&gt;

&lt;p&gt;Import yield_historical_in.json into a collection named &apos;yield_historical.in&apos;&lt;/p&gt;

&lt;p&gt;And then run the attached .js file against the mongo shell.&lt;/p&gt;

&lt;p&gt;Merging into a non-existent collection works.&lt;/p&gt;

&lt;p&gt;Reducing into an existing collection works.&lt;/p&gt;

&lt;p&gt;Reducing into a NON existing collection fails.&lt;/p&gt;</comment>
                            <comment id="22678" author="eliot" created="Tue, 25 Jan 2011 21:44:44 +0000"  >&lt;p&gt;you should make a .js file that reproduces this&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10737" name="reproduceMRReduceOutIssue.js" size="1270" author="brendan" created="Tue, 25 Jan 2011 22:10:12 +0000"/>
                            <attachment id="10738" name="yield_historical_in.json" size="1401173" author="brendan" created="Tue, 25 Jan 2011 22:10:12 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 25 Jan 2011 21:44:44 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 4 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 4 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>brendan</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp7y7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hricrj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>20719</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrljfr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>