This would be a good jira to create at (
https://issues.apache.org/jira/projects/SOLR)

Interesting that the query works in MySQL. I'm assuming MySQL automatically
adds the group by field to the field list. We can look at doing this as
well.

Joel Bernstein
http://joelsolr.blogspot.com/

On Tue, Oct 17, 2017 at 6:48 AM, Dmitry Gerasimov <dgerasi...@kommunion.com>
wrote:

> Joel,
>
> Thanks for the tip. That worked. I was confused since this query works
> just fine in MySQL.
> It would of course be very helpful if SOLR was responding with a
> proper error. What’s the process here? Where do I post this request?
>
> Dmitry
>
>
>
>
> > ---------- Forwarded message ----------
> > From: Joel Bernstein <joels...@gmail.com>
> > To: solr-user@lucene.apache.org
> > Cc:
> > Bcc:
> > Date: Mon, 16 Oct 2017 11:16:28 -0400
> > Subject: Re: Parallel SQL: GROUP BY throws exception
> > Ok, I just the read the query again.
> >
> > Try the failing query like this:
> >
> > SELECT people_person_id, sum(amount) as total FROM donation GROUP BY
> > people_person_id
> >
> > That is the correct syntax for the SQL group by aggregation.
> >
> > It looks like you found a null pointer though where a proper error
> message
> > is needed.
> >
> >
> > Joel Bernstein
> > http://joelsolr.blogspot.com/
> >
> > On Mon, Oct 16, 2017 at 9:49 AM, Joel Bernstein <joels...@gmail.com>
> wrote:
> >
> > > Also what version are you using?
> > >
> > > Joel Bernstein
> > > http://joelsolr.blogspot.com/
> > >
> > > On Mon, Oct 16, 2017 at 9:49 AM, Joel Bernstein <joels...@gmail.com>
> > > wrote:
> > >
> > >> Can you provide the stack trace?
> > >>
> > >> Are you in SolrCloud mode?
> > >>
> > >>
> > >>
> > >> Joel Bernstein
> > >> http://joelsolr.blogspot.com/
> > >>
> > >> On Mon, Oct 16, 2017 at 9:20 AM, Dmitry Gerasimov <
> > >> dgerasi...@kommunion.com> wrote:
> > >>
> > >>> Hi all!
> > >>>
> > >>> This query works as expected:
> > >>> SELECT sum(amount) as total FROM donation
> > >>>
> > >>> Adding GROUP BY:
> > >>> SELECT sum(amount) as total FROM donation GROUP BY people_person_id
> > >>>
> > >>> Now I get response:
> > >>> {
> > >>>   "result-set":{
> > >>>     "docs":[{
> > >>>         "EXCEPTION":"Failed to execute sqlQuery 'SELECT sum(amount)
> as
> > >>> total  FROM donation GROUP BY people_person_id' against JDBC
> connection
> > >>> 'jdbc:calcitesolr:'.\nError while executing SQL \"SELECT sum(amount)
> as
> > >>> total  FROM donation GROUP BY people_person_id\": null",
> > >>>         "EOF":true,
> > >>>         "RESPONSE_TIME":279}]}
> > >>> }
> > >>>
> > >>> Any ideas on what is causing this? Or how to debug?
> > >>>
> > >>>
> > >>> Here is the collection structure:
> > >>>
> > >>> <field name="id" type="string" indexed="true" stored="true"
> > >>> required="true"
> > >>> multiValued="false"/>
> > >>> <field name="people_person_id" type="int" indexed="true"
> stored="true"
> > >>> required="true" multiValued="false" docValues="true"/>
> > >>> <field name="group_id" type="int" indexed="true" stored="false"
> > >>> required="true" multiValued="false"/>
> > >>> <field name=“amount" type="float" indexed="true" stored="true"
> > >>> multiValued="false" docValues="true"/>
> > >>>
> > >>>
> > >>> Thanks!
> > >>>
> > >>
> > >>
> > >
> >
>

Reply via email to