tindzk opened a new pull request, #3443:
URL: https://github.com/apache/calcite/pull/3443

   The following query fails with a `JsonParseException`:
   
   ```sql
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to