Distinct does not work with count for a field

Description

If you try to count distinct contents of a field, AO does not generate the right SQL query and it ignores the specified field.

For example, this code:

1 ao.count(MyObject.class, Query.select("FIELD_NAME").distinct());

generates the following SQL query

1 SELECT DISTINCT COUNT(*) FROM AO_123_TABLE_NAME

when the expected code should be something like:

1 SELECT COUNT(DISTINCT FIELD_NAME) FROM AO_123_TABLE_NAME

Environment

None

Testing Notes

None

Status

Assignee

Piotr Suwala

Reporter

Alejandro Conde Carrillo

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Fix versions

Priority

Major
Configure