Description
Currently, we nievely add RAW to every COUNT function, which means queries like this fail because its a SQL++ syntax error:
SELECT `c`.`EnrollmentDate` as `EnrollmentDate`, RAW COUNT(*) as `StudentCount`
|
FROM `contoso`.`person`.`person` AS `c`
|
WHERE `c`.`Discriminator` = "Student"
|
GROUP BY `c`.`EnrollmentDate`
|
We only want to add RAW for queries that look like this:
SELECT COUNT(*)
|
FROM `contoso`.`person`.`person` AS `c`
|
WHERE `c`.`Discriminator` = "Student"
|
Which results in:
[
|
{
|
"$1": 8
|
}
|
]
|
If RAW is added to the query, then the output will look like:
[
|
8
|
]
|
The alternative is to detect the nesting on deserialization and treat it as a scalar value.