[CALCITE-3330] propagateCostImprovements() could result in stack over…#1445
Closed
xndai wants to merge 1 commit intoapache:masterfrom
Closed
[CALCITE-3330] propagateCostImprovements() could result in stack over…#1445xndai wants to merge 1 commit intoapache:masterfrom
xndai wants to merge 1 commit intoapache:masterfrom
Conversation
…flow Current implementation uses depth first approach for propagating cost improvements to parent rel nodes. This could lead to stack overflow if the rel node hierarchy is very deep. Fix this by using breath first approach for cost propagation.
Contributor
Author
|
I have a UT failure at MongoAdapterTest.testGroupByAvgSumCount() due to the operator sequence change. My understand is this does not actually affect the plan. But would appreciate if someone is more familiar with the background can review it. Thx. |
danny0405
reviewed
Oct 10, 2019
| "{$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'}}" | ||
| )); |
Contributor
There was a problem hiding this comment.
I'm a little confused why the plan has changed, because this patch seems have equivalent logic function as before.
Contributor
Author
There was a problem hiding this 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.
Contributor
There was a problem hiding this comment.
You mean the planner choose a same cost plan with before but with different structure ?
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/calcite
that referenced
this pull request
Nov 17, 2019
…ements Current implementation uses depth first approach for propagating cost improvements to parent rel nodes. This could lead to stack overflow if the rel node hierarchy is very deep. Fix this by using breath first approach for cost propagation. Close apache#1445
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/calcite
that referenced
this pull request
Nov 20, 2019
…ements Current implementation uses depth first approach for propagating cost improvements to parent rel nodes. This could lead to stack overflow if the rel node hierarchy is very deep. Fix this by using breath first approach for cost propagation. Close apache#1445
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/calcite
that referenced
this pull request
Nov 20, 2019
…ements Current implementation uses depth first approach for propagating cost improvements to parent rel nodes. This could lead to stack overflow if the rel node hierarchy is very deep. Fix this by using breath first approach for cost propagation. Close apache#1445
wangxlong
pushed a commit
to wangxlong/calcite
that referenced
this pull request
Feb 13, 2020
…ements Current implementation uses depth first approach for propagating cost improvements to parent rel nodes. This could lead to stack overflow if the rel node hierarchy is very deep. Fix this by using breath first approach for cost propagation. Close apache#1445
jamesstarr
pushed a commit
to jamesstarr/calcite
that referenced
this pull request
Aug 28, 2025
…ements Current implementation uses depth first approach for propagating cost improvements to parent rel nodes. This could lead to stack overflow if the rel node hierarchy is very deep. Fix this by using breath first approach for cost propagation. Close apache#1445 Change-Id: I7581dd6a5d81f9755af79e270e7900197d42ae72
jamesstarr
pushed a commit
to jamesstarr/calcite
that referenced
this pull request
Mar 16, 2026
…ements Current implementation uses depth first approach for propagating cost improvements to parent rel nodes. This could lead to stack overflow if the rel node hierarchy is very deep. Fix this by using breath first approach for cost propagation. Close apache#1445 Change-Id: I7581dd6a5d81f9755af79e270e7900197d42ae72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…flow
Current implementation uses depth first approach for propagating cost improvements to parent rel nodes. This could lead to stack overflow if the rel node hierarchy is very deep. Fix this by using breath first approach for cost propagation.