NobiGo commented on code in PR #4228:
URL: https://github.com/apache/calcite/pull/4228#discussion_r1988281117
##########
mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java:
##########
@@ -605,12 +607,7 @@ private CalciteAssert.AssertThat assertModel(URL url) {
+ " ]\n"
+ " }\n"
+ "}",
- "{$project: {CITY: '$city', STATE: '$state'}}",
- "{$group: {_id: {CITY: '$CITY', STATE: '$STATE'}}}",
- "{$project: {_id: 0, CITY: '$_id.CITY', STATE: '$_id.STATE'}}",
- "{$group: {_id: '$STATE', CDC: {$sum: {$cond: [ {$eq: ['CITY',
null]}, 0, 1]}}}}",
- "{$project: {STATE: '$_id', CDC: '$CDC'}}",
- "{$sort: {STATE: 1}}"));
+ "{$project: {STATE: '$state', CITY: '$city'}}"));
Review Comment:
I'm not very familiar with the mongo adapter. However, judging from the
plan, the script here seems to have problems. The previous test cases looked
correct from the perspective of SQL semantics. But now this plan has lost the
`group by` and `order by` clauses. I guess we can check whether the related
operations have been completed through Enumerable by adding explainContains.
--
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]