[MarkLogic Dev General] cts:sum-aggregate returned incorrect result

Lien Suandy lhsuandy at gmail.com
Thu Mar 5 16:35:25 PST 2015


Yes, I did, it made no difference.

On Thu, Mar 5, 2015 at 3:58 PM, Danny Sokolsky <Danny.Sokolsky at marklogic.com
> wrote:

>  Did you try this with item-frequency passed in as an option to
> cts:sum-aggregate?
>
>
>
> -Danny
>
>
>
> *From:* general-bounces at developer.marklogic.com [mailto:
> general-bounces at developer.marklogic.com] *On Behalf Of *Lien Suandy
> *Sent:* Thursday, March 05, 2015 3:49 PM
> *To:* MarkLogic Developer Discussion
> *Subject:* [MarkLogic Dev General] cts:sum-aggregate returned incorrect
> result
>
>
>
> I'm testing the cts:sum-aggregate function on a database with 100 million
> documents.  There exists a range index for an element, num, I used for this
> test.
>
>
>
> Evaluating this:
>
>
>
>             cts:sum-aggregate(cts:element-reference(xs:QName("num")))
>
>
>
> This returns the result
>
>
>
>             ==> 832,332,413  (: commas inserted for viewing :)
>
>
>
> Since I know that num falls in the range of 1980 - 2010 and I know every
> document in the collection has exactly one 'num' element.  I expect the
> result to be around
>
>
>
>             200,000,000,000
>
>
>
> I also verified by running the DEPRECATED function, cts:sum
>
>
>
>             cts:sum(cts:element-values(xs:QName("num"), (), ("type=int")))
>
>
>
> The result from cts:sum is what I had expected:
>
>
>
>             ==> 202,695,795,325 (: commas inserted for viewing :)
>
>
>
> I also did another test in a smaller database, here, the cts:sum-aggregate
> function gave the correct result.  Can someone explain?
>
>
>
>
>
> Thanks,
>
>
>
> Lien
>
> _______________________________________________
> General mailing list
> General at developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
>
>


-- 
Lien H. Suandy
NoSQL Data Architect / Consultant

   - www.linkedin.com/in/liensuandy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20150305/176cdeb0/attachment.html 


More information about the General mailing list