Skip to content

Conversation

@LiBinfeng-01
Copy link
Contributor

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