<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Thu May 23 18:55:45 CDT 2013

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 add field=key&field=summary to the URL of your request.
For example:
http://www.couchbase.com/issues/si/jira.issueviews:issue-xml/JCBC-150/JCBC-150.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Couchbase</title>
    <link>http://www.couchbase.com/issues</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.4</version>
        <build-number>845</build-number>
        <build-date>26-12-2012</build-date>
    </build-info>

<item>
            <title>[JCBC-150] &quot;Failed to access the view&quot; error when querying a view with reduce</title>
                <link>http://www.couchbase.com/issues/browse/JCBC-150</link>
                <project id="10080" key="JCBC">Couchbase Java Client</project>
                        <description>Attempting to make a call to CouchbaseClient.query(view, query) with a view that has a reduce (even just &amp;quot;_count&amp;quot;) results in the following exception when results are returned:&lt;br/&gt;
&lt;br/&gt;
java.lang.RuntimeException: Failed to access the view&lt;br/&gt;
	at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:634) &lt;br/&gt;
&lt;br/&gt;
Worth noting:&lt;br/&gt;
- If the query returns no results (ViewResponse.size() returns 0), you do not get the exception...&lt;br/&gt;
- If the reduce method is removed from the view, everything works fine.  However, using query.setReduce(false) does not work.&lt;br/&gt;
&lt;br/&gt;
</description>
                <environment></environment>
            <key id="20845">JCBC-150</key>
            <summary>&quot;Failed to access the view&quot; error when querying a view with reduce</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10011">Public</security>
                        <assignee username="daschl">Michael Nitschinger</assignee>
                                <reporter username="ctash_jt">Chris Tashjian</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Nov 2012 17:57:29 -0600</created>
                <updated>Tue, 27 Nov 2012 09:30:15 -0600</updated>
                    <resolved>Tue, 27 Nov 2012 09:30:15 -0600</resolved>
                            <version>1.1-dp4</version>
                                                <component>library</component>
                                <votes>0</votes>
                        <watches>1</watches>
                                                    <comments>
                    <comment id="44417" author="daschl" created="Tue, 20 Nov 2012 06:29:43 -0600"  >Hi Chris,&lt;br/&gt;
&lt;br/&gt;
thanks for the report. I&amp;#39;ll investigate and let you know!&lt;br/&gt;
&lt;br/&gt;
Thanks,&lt;br/&gt;
Michael</comment>
                    <comment id="44520" author="daschl" created="Wed, 21 Nov 2012 04:36:06 -0600"  >Please make sure to use setReduce(true) and .setReduce(false) explicitely on a view with a reduce function right now.&lt;br/&gt;
&lt;br/&gt;
The following code works with setReduce(true) and false, but will throw the exception you mentioned when setReduce is not used at all:&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;query = new Query();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//query.setReduce(false);&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;view = client.getView(DESIGN_DOC_W_REDUCE, VIEW_NAME_W_REDUCE);&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;reduce = client.query(view, query);&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;itr = reduce.iterator();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while(itr.hasNext()) {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ViewRow row = itr.next();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(row.getKey());&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;
&lt;br/&gt;
</comment>
                    <comment id="44523" author="daschl" created="Wed, 21 Nov 2012 05:08:25 -0600"  >After more investigation, this is really a shortcoming and should be handled in this changeset:&lt;br/&gt;
&lt;br/&gt;
&lt;a href=&quot;http://review.couchbase.org/#/c/22710/&quot;&gt;http://review.couchbase.org/#/c/22710/&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
It makes sure that reduce = true when nothing is set and the view contains a reduce function. The exception was misleading because it covered a JSON parsing bug underneath.</comment>
                    <comment id="44845" author="daschl" created="Tue, 27 Nov 2012 09:30:15 -0600"  >fixed and pushed to master; will be available in dp5/beta.</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                                                                                                                                                    <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>8663</customfieldvalue>
                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10181" key="com.atlassian.jira.ext.charting:timeinstatus">
                <customfieldname>Time In Status</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                </customfields>
    </item>
</channel>
</rss>