danny0405 commented on a change in pull request #1445: [CALCITE-3330] 
propagateCostImprovements() could result in stack over…
URL: https://github.com/apache/calcite/pull/1445#discussion_r333310599
 
 

 ##########
 File path: 
mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java
 ##########
 @@ -470,11 +470,12 @@ private static void populate(MongoCollection<Document> 
collection, URL resource)
             + "STATE=AL; A=43383; S=130151; C=3\n")
         .queryContains(
             mongoChecker(
-                "{$project: {POP: '$pop', STATE: '$state'}}",
+                "{$project: {STATE: '$state', POP: '$pop'}}",
                 "{$group: {_id: '$STATE', _1: {$sum: '$POP'}, _2: {$sum: 
{$cond: [ {$eq: ['POP', null]}, 0, 1]}}}}",
                 "{$project: {STATE: '$_id', _1: '$_1', _2: '$_2'}}",
-                "{$project: {STATE: 1, A: {$divide: [{$cond:[{$eq: ['$_2', 
{$literal: 0}]},null,'$_1']}, '$_2']}, S: {$cond:[{$eq: ['$_2', {$literal: 
0}]},null,'$_1']}, C: '$_2'}}",
-                "{$sort: {STATE: 1}}"));
+                "{$sort: {STATE: 1}}",
+                "{$project: {STATE: 1, A: {$divide: [{$cond:[{$eq: ['$_2', 
{$literal: 0}]},null,'$_1']}, '$_2']}, S: {$cond:[{$eq: ['$_2', {$literal: 
0}]},null,'$_1']}, C: '$_2'}}"
+                ));
 
 Review comment:
   I'm a little confused why the plan has changed, because this patch seems 
have equivalent logic function as before.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to