@yebaros: count() is not allowed inside group by, count(uid) should be used instead. I have pushed a fix to master so that user will see relevant error message.
The count() actually helps in giving an top level aggregate of all nodes used in the group by operation. And count(uid) was returning count of each individual group.
It helped us retrieve results in one query instead of 2. Instead of removing the functionality , just correctng the json stucture helps so that only count is returned in a valid json.
count() works on top level, everything within groupby block works on a group and not on top level. We changed it to have a consistent query language syntax.
Yes i understand that but effectively its a different query.
Please can you confirm in the original query where count and count uid was used how many read is required to arrive at output and similarly when it is used in separate queries would it end up parsing all of the records twice.
Syntactically please can we discuss if there are any pitfalls in maintaining this format of syntax as a feature.
The query mentioned by @janardhan shouldn’t be any slower. Note that DP has already been calculated. So, all we’re doing in Breakdown2 is to count the length of this DP variable, which is very cheap.
The issue with maintaining a count() along with count(uid) is complexity. It would be confusing to a user, when to use one and when to use another – we try to keep things as simple as possible in the language.