ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristi C <chi...@sky.optymyze.com>
Subject Count distinct not working?
Date Thu, 07 Jul 2016 11:33:24 GMT
Hello,
I was looking into how Ignite performs SQL queries across multiple nodes and
I ran into a possible issue. It looks to me like COUNT DISTINCT is not
working properly. I haven't found anything in Jira or in the mailing list
about this so I decided to ask here first.
My code is something like:
QueryCursor<List&lt;?>> results = cache.query(new SqlFieldsQuery("SELECT
COUNT(DISTINCT C1) from T1"));
results.getAll();

This is split into the following map and reduce queries:
SELECT COUNT(DISTINCT REGION) __C0 FROM "S".T1
SELECT CAST(SUM(__C0) AS BIGINT) __C0 FROM PUBLIC.__T0
As I see it, for this to be correct, the queries should be something like:
SELECT DISTINCT REGION __C0 FROM "S".T1
SELECT COUNT(DISTINCT __C0) __C0 FROM PUBLIC.__T0

Is this a known issue? (Has it been reported and I just missed it?)
Do you know of any other cases where queries across a distributed cache
would not be split into the correct map/reduce queries?

Thanks,
   Cristi




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Count-distinct-not-working-tp6144.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message