Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.35.0
Description
The following query fails with a JsonParseException:
select state as "STATE", avg(pop) as "AVG(pop)" from zips group by "STATE" order by "AVG(pop)"
Stack trace:
org.bson.json.JsonParseException: JSON reader was expecting ':' but found '('. at org.bson.json.JsonReader.readBsonType(JsonReader.java:150) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:85) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:42) at org.bson.codecs.BsonDocumentCodec.readValue(BsonDocumentCodec.java:104) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:87) at org.bson.BsonDocument.parse(BsonDocument.java:66) at org.apache.calcite.adapter.mongodb.MongoTable.aggregate(MongoTable.java:138) at org.apache.calcite.adapter.mongodb.MongoTable.access$200(MongoTable.java:53) at org.apache.calcite.adapter.mongodb.MongoTable$MongoQueryable.aggregate(MongoTable.java:189)
This is caused by the column name in the "order by" clause not being escaped.
Attachments
Issue Links
- links to