Aggregate query bug when grouping by Id

Issue #1826 resolved
Matej Mercina created an issue

When attempting to run a query such as this one:

SELECT AccountId, Account.Name, MAX(CloseDate), Id
FROM Opportunity WHERE IsClosed = TRUE GROUP BY AccountId,Account.Name, Id

an error occurs:

org.apache.cxf.binding.soap.SoapFault: MALFORMED_QUERY:
SELECT COUNT(Id)
^
ERROR at Row:1:Column:14
Grouped field should not be aggregated: Id

The same query runs fine in developer console.

Comments (2)

  1. Scott Wells repo owner

    Fix committed for inclusion in the next release. I also added more general error handling such that if result set size validation fails due to MALFORMED_QUERY, it will just log and move on assuming that the query IC2 has created for result set size validation wasn't correct for whatever reason.

  2. Log in to comment