Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 76696 invoked from network); 7 Aug 2010 00:25:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Aug 2010 00:25:22 -0000 Received: (qmail 61776 invoked by uid 500); 7 Aug 2010 00:25:21 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 61743 invoked by uid 500); 7 Aug 2010 00:25:20 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 61735 invoked by uid 99); 7 Aug 2010 00:25:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Aug 2010 00:25:20 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jchris@gmail.com designates 209.85.212.180 as permitted sender) Received: from [209.85.212.180] (HELO mail-px0-f180.google.com) (209.85.212.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Aug 2010 00:25:15 +0000 Received: by pxi3 with SMTP id 3so4892822pxi.11 for ; Fri, 06 Aug 2010 17:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=hHk1vSN/b3a6K4fdHEzayadkyp33qTGWvAQALV0hPwI=; b=OGy8piWdKsjg41nGwMcu7aqIJfavfmvIJB4LT1AqMmwFm7B+8qG9Qz/iEmLczID+DQ T4fOP1gE0fuHKXJxOmfDmGwbipVuZELYeD8P4zQleA3hr/XLabtvAYpfL6TKck+OuEn5 VYNuB/QyXs8eEzvm9YQixREtis4RB4l8KcARE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=hGbDG8RvwXMRsTm59eRJjNeUSSQIGaN0Iap3Mpe3zgGnDH6pSt2zgyBxpffLQsps8Y uD4TF+H97JdDj7bQgPUuWePZYAMJRy5hoM8G+E35slrKixgtlPbffGfXPUGqIKywWIat CSVFw7Q2kjAAmikBffB2XipnOPbRRZjK/iWTA= Received: by 10.114.137.15 with SMTP id k15mr14750959wad.217.1281140695393; Fri, 06 Aug 2010 17:24:55 -0700 (PDT) Received: from [192.168.1.102] (c-98-248-172-14.hsd1.ca.comcast.net [98.248.172.14]) by mx.google.com with ESMTPS id q6sm3848191waj.10.2010.08.06.17.24.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 06 Aug 2010 17:24:53 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) Subject: Re: Crash when using builtin reduce _stats From: J Chris Anderson In-Reply-To: Date: Fri, 6 Aug 2010 17:24:51 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <327C4C74-0F10-4F43-B18F-79BAD91717C1@gmail.com> References: <50582255-EA47-4DDA-A182-13F54F9B1BF6@apache.org> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1081) On Aug 6, 2010, at 5:21 PM, Yue Chuan Lim wrote: > I highly doubt it, modifying the function to: >=20 > function(doc) { > if(doc.data[12] > 0) { > key =3D doc._id.split("|")[0]; > emit(doc.data[12], doc.data[12]); > } > } >=20 > and sorting by key, it appears all the numbers are indeed numbers. >=20 > function(doc) { > if(doc.data[12] > 0) { > key =3D doc._id.split("|")[0]; > if(doc.data[12] !=3D parseInt(doc.data[12])) { > emit(doc.data[12], doc.data[12]); > } > } > } >=20 > Returns a empty set. >=20 > On a hunch, I removed the doc.data[12] > 0 line, and the query seems = to run > fine >=20 > (with group=3Dtrue) >=20 > {"rows":[ > = {"key":"gsc_test_01","value":{"sum":335168,"count":1000,"min":0,"max":389,= "sumsqr":128263850}}, > = {"key":"gsc_test_02","value":{"sum":381805,"count":1000,"min":0,"max":765,= "sumsqr":176920147}}, > = {"key":"gsc_test_03","value":{"sum":411391,"count":1000,"min":187,"max":76= 1,"sumsqr":178307983}} > ]} >=20 > So it appears that _stats doesn't like value sets without 0s :P (or = maybe > reduce + group=3Dtrue has something against unequal count values) >=20 > Thanks for looking into this :) Since there isn't an easy answer in sight, and I'm up to my neck in = other patches right now, maybe the best thing to do is start a Jira = ticket to record your observations while they are still fresh. http://issues.apache.org/jira/browse/COUCHDB Thanks, Chris > Yue Chuan >=20 >=20 > On Sat, Aug 7, 2010 at 8:13 AM, J Chris Anderson = wrote: >=20 >>=20 >> On Aug 6, 2010, at 5:09 PM, Yue Chuan Lim wrote: >>=20 >>> Further tested on the couch.io windows installer as well as a >>> couch.ioinstance with the same results, works on a temp view, = crashes >>> on a actual >>> view. >>>=20 >>>=20 >> = shasderias.couchone_remove_me_.com/_utils/database.html?gsc_lt2/_design/st= ats/_view/active_power >>>=20 >>> is the couchone instance. >>=20 >> Is there any chance you have a few docs where the value is not a = number? If >> you remove the reduce function completely and query the map is every = single >> row's value a number? >>=20 >> Thanks for helping us get to the bottom of this. >>=20 >> Chris >>=20 >>>=20 >>> On Fri, Aug 6, 2010 at 9:01 PM, Yue Chuan Lim >> wrote: >>>=20 >>>> And curiously enough, running it as a temp view works just fine. >>>>=20 >>>> [info] [<0.1859.0>] 127.0.0.1 - - 'POST' >>>> /gsc_lt2/_temp_view?limit=3D11&descending=3Dtrue&group=3Dtrue 200 >>>>=20 >>>>=20 >>>> On Fri, Aug 6, 2010 at 8:38 PM, Yue Chuan Lim >> wrote: >>>>=20 >>>>> Fairly standard map/reduce function, map looks something like >>>>>=20 >>>>> function(doc) { >>>>> if(doc.data[12] > 0) { >>>>> key =3D doc._id.split("|")[0]; >>>>> emit(key, doc.data[12]); >>>>> } >>>>> } >>>>>=20 >>>>> Data returned by map is along the lines of: ("test1", 123), = ("test1", >>>>> 245). >>>>>=20 >>>>> Reduce is just: _stats >>>>>=20 >>>>> Crash log: http://pastebin.com/aX7jeeLm >>>>> Platform: Windows 7 (32-bit) >>>>>=20 >>>>> Using the installer by Mark Hammond. Incidentally, is the = installer on >>>>> couch.io the preferred one for windows deployment? >>>>>=20 >>>>> Thanks >>>>>=20 >>>>>=20 >>>>>=20 >>>>=20 >>=20 >>=20