Re: Error when using aggregates with correlated subqueries

2015-04-26 Thread Maryann Xue
Glad that your queries worked. Please do let us know if any further problems. The bug is with EXISTS. Right now Phoenix does not handle aggregate function calls correctly within an EXISTS subquery or EXISTS nested subquery. I have opened a JIRA: https://issues.apache.org/jira/browse/PHOENIX-1923.

Re: Error when using aggregates with correlated subqueries

2015-04-26 Thread khaleel mershad
I don't think that the bug is with EXISTS. As you can see with the query from my last email, it contains a nested correlated subquery which contains an aggregate within *EXISTS* and it worked after replacing the reference to the outer table (W.rowId) with a reference to the inner subquery table

Re: Error when using aggregates with correlated subqueries

2015-04-26 Thread khaleel mershad
Thanks for the explanation. I see what you mean. I will also try testing a query that contains nested correlated subqueries with multiple level outer reference, and with using IN instead of EXISTS and I will see if it produces an error. Best, Khaleel On Sun, Apr 26, 2015 at 7:14 PM, Maryann

Re: Error when using aggregates with correlated subqueries

2015-04-26 Thread Maryann Xue
Hi Khaleel, Thanks for looking into the problem! But there IS a bug with EXISTS having an aggregate function, say max(H.timestamp) as used in your very first query that did not work. Otherwise, if subquery is SELECT * or SELECT column1 or SELECT substr(column1), it's fine coz there is no

Re: Error when using aggregates with correlated subqueries

2015-04-26 Thread Maryann Xue
Thank you in advance! Just let me know. Thanks, Maryann On Sunday, April 26, 2015, khaleel mershad khellom...@gmail.com wrote: Thanks for the explanation. I see what you mean. I will also try testing a query that contains nested correlated subqueries with multiple level outer reference,