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

refactor: refactor cte binder and fix materialized cte used in subquery #16785

Merged
merged 12 commits into from
Nov 14, 2024

Conversation

xudong963
Copy link
Member

@xudong963 xudong963 commented Nov 7, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  1. Move cte context from Binder to BindContext to make materialized cte used in subquery(Subquery will use a new Binder to bind it, if cte context is in Binder, it isn't convenient to make the main query wrap m cte).
  2. Remove m_cte_bound_ctx and used_count, they're not necessary to maintain.

After refactoring, the cte-related code is more maintainable and extensible.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@xudong963 xudong963 marked this pull request as draft November 7, 2024 07:03
@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Nov 7, 2024
@xudong963 xudong963 changed the title refactor: refactor cte binder refactor: refactor cte binder and fix materialized cte used in subquery Nov 13, 2024
@xudong963 xudong963 marked this pull request as ready for review November 13, 2024 07:53
@Dousir9 Dousir9 added this pull request to the merge queue Nov 14, 2024
Merged via the queue into databendlabs:main with commit 2ccede3 Nov 14, 2024
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-refactor this PR changes the code base without new features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: materialized cte panic
2 participants