You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/10/10 03:33:56 UTC
[GitHub] [calcite] xndai commented on a change in pull request #1445: [CALCITE-3330] propagateCostImprovements() could result in stack over…
xndai 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_r333317675
##########
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:
It's possible because the sequence of cost propagation is changed now thus the memo can be different. But anyway the plan is equivalent.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services