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(core): disable CommonSubexprEliminate to avoid generate invalid plan for unparsing #917

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

goldmedal
Copy link
Contributor

Description

CommonSubexprEliminate is used to clean up the duplicate expressions. However, it could generate a plan like

     Projection: c.properties_first AS contact_first_name, c.properties_last AS contact_last_name, c.properties_e AS properties_e_a
      Projection: c.createdAt, c.properties_e, c.properties_first, c.properties_last
        Filter: __common_expr_1 >= CAST(CAST(Utf8("2024-11-01 00:00:00") AS Timestamp(Nanosecond, None)) AS Timestamp(Nanosecond, Some("+00:00"))) AND __common_expr_1 < CAST(CAST(Utf8("2024-11-15 00:00:00") AS Timestamp(Nanosecond, None)) AS Timestamp(Nanosecond, Some("+00:00")))
          Projection: CAST(c.createdAt AS Timestamp(Nanosecond, Some("+00:00"))) AS __common_expr_1, c.createdAt, c.properties_e, c.properties_first, c.properties_last

This plan has continued projection plans that cause an anonymous subquery. There are some issues with the continued projection plans for the unparsing.

This PR disables it to avoid generating this kind of plan.

@github-actions github-actions bot added core rust Pull requests that update Rust code labels Nov 18, 2024
@goldmedal goldmedal changed the title fix(core) disable CommonSubexprEliminate to avoid generate invalid plan for unparsing fix(core): disable CommonSubexprEliminate to avoid generate invalid plan for unparsing Nov 18, 2024
@goldmedal goldmedal marked this pull request as ready for review November 18, 2024 09:12
Copy link
Contributor

@grieve54706 grieve54706 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grieve54706 grieve54706 merged commit 6bedc03 into Canner:main Nov 19, 2024
14 of 15 checks passed
@grieve54706 grieve54706 added this to the 0.12.1 milestone Nov 20, 2024
grieve54706 pushed a commit that referenced this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants