Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](Nereids) fix leading with cte and same subqueryalias name #35600

Merged
merged 1 commit into from
May 29, 2024

Conversation

LiBinfeng-01
Copy link
Collaborator

@LiBinfeng-01 LiBinfeng-01 commented May 29, 2024

cherry-pick: #34838
fix leading with cte and same subqueryalias name
Example:
with tbl1 as select t1.c1 from t1
select tbl2.c2 from (select / * + leading(t2 tbl1) * / tbl1.c1, t2.c2 from tbl1 join t2) as tbl2 join t3; Reason:
in this case, before getting analyzed preprocess would change subquery tbl2 to cte plan, and this cte plan should be in upper level cte plan, but not in logical result sink plan

…he#34838)

fix leading with cte and same subqueryalias name
Example:
with tbl1 as select t1.c1 from t1
select tbl2.c2 from (select / * + leading(t2 tbl1) * / tbl1.c1, t2.c2 from tbl1 join t2) as tbl2 join t3;
Reason:
in this case, before getting analyzed preprocess would change subquery tbl2 to cte plan, and this cte plan should be in upper level cte plan, but not in logical result sink plan
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@LiBinfeng-01
Copy link
Collaborator Author

run buildall

@morrySnow morrySnow changed the title [Fix](Nereids) fix leading with cte and same subqueryalias name (#34838) [Fix](Nereids) fix leading with cte and same subqueryalias name May 29, 2024
@morrySnow morrySnow merged commit a48d93f into apache:branch-2.0 May 29, 2024
26 of 28 checks passed
mongo360 pushed a commit to mongo360/doris that referenced this pull request Aug 16, 2024
…he#35600)

cherry-pick: apache#34838

fix leading with cte and same subqueryalias name.

Example:

with tbl1 as select t1.c1 from t1
select tbl2.c2 from (select / * + leading(t2 tbl1) * / tbl1.c1, t2.c2
from tbl1 join t2) as tbl2 join t3;

Reason:
in this case, before getting analyzed preprocess would change subquery
tbl2 to cte plan, and this cte plan should be in upper level cte plan,
but not in logical result sink plan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants