tuichenchuxin commented on code in PR #4228:
URL: https://github.com/apache/calcite/pull/4228#discussion_r1988310846


##########
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 found the implementation of group and count distinct is not implemented by 
mongo statements, but through code and API
   
https://github.com/apache/calcite/blob/618e601b136e92db933523f77dd7af3c1dfe2779/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoToEnumerableConverter.java#L113-L116
   
   
https://github.com/apache/calcite/blob/618e601b136e92db933523f77dd7af3c1dfe2779/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java#L131-L153



-- 
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