Hi, Have you confirmed incorrect query results or it's just your suggestion based on query plan ?
2016-07-07 14:33 GMT+03:00 Cristi C <[email protected]>: > 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<?>> 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. > -- Best regards, Alexei Scherbakov
