-
1. Re: Continuous queries with Group by clause returns incorrect results when it points to Tables
shawkins Feb 18, 2013 9:22 AM (in response to madhu.garimilla)Why would you expect a count of anything other than 1 if you are grouping by name also? Do you mean to count the ids instead?
Steve
-
2. Re: Continuous queries with Group by clause returns incorrect results when it points to Tables
madhu.garimilla Feb 18, 2013 11:15 AM (in response to shawkins)Hi Steve,
Thanks for the reply.
My table TEST looks like below
ID NAME
--- -----
1 abc
2 def
3 def
4 abc
5 abc
With the given query I am expecting the results like below-> Results-1
NAME COUNT
--- -----
abc 3
def 2
But it is returning results like below -> Results-2
NAME COUNT
--- -----
abc 1
def 1
I am attaching the modified test case which doesn't have any continuous executions.
We observed that, if we use Teiid connection to connect and internally it is using TeiidPreparedStatementImpl, which is giving result set as Results-2.
If we use H2 connection, and it is returning proper results as mentioned in Results-1.
-
3. Re: Continuous queries with Group by clause returns incorrect results when it points to Tables
shawkins Feb 18, 2013 2:03 PM (in response to madhu.garimilla)Sorry, ignore my first comment. I had to take a second look at what you had (in general a test case that is free of external dependencies is need). This is unrelated to continusous queries. The aggregate decomposition has a bug in the case of count(col) that matters in this and in similar circumstances. I've logged https://issues.jboss.org/browse/TEIID-2397 for this. In your case you can use the workaround of count(*) if you do not expect any null names or you can add a null check if you do.
Steve
-
4. Re: Continuous queries with Group by clause returns incorrect results when it points to Tables
rajkota Feb 18, 2013 7:59 PM (in response to shawkins)Thanks Steve, your workaround is working fine in our test case.
Thanks, Raj