Conversation
…rate modules Code quality improvements to bring modules to Grade A level: **logical_expr/mod.rs** (1404 → 947 lines, -33%): - Extract duplicated AST conversions to ast_conversion.rs (525 lines) - Module now contains only type definitions and core logic **plan_ctx/mod.rs** (1391 → 1160 lines, -17%): - Extract TableCtx to table_ctx.rs (310 lines) - Refactor new_with_cte_reference to break circular dependency - Update graph_join_inference.rs to use new API Files added: - logical_expr/ast_conversion.rs: From/TryFrom impls for AST conversion - logical_expr/combinators.rs: Expression combinators (already existed, now declared) - logical_expr/visitors.rs: Visitor pattern for expression traversal - plan_ctx/table_ctx.rs: TableCtx struct and implementation - plan_ctx/builder.rs: Builder pattern (already existed, now declared) All 832 tests passing (single-threaded; pre-existing flaky test in parallel mode)
There was a problem hiding this comment.
Pull request overview
This pull request refactors the query planner modules by extracting code into separate, focused modules to improve code quality and maintainability. The primary goal is to achieve Grade A code quality by reducing module sizes and improving code organization.
Changes:
- Extracted
TableCtxfromplan_ctx/mod.rstoplan_ctx/table_ctx.rs(310 lines) - Extracted AST conversion implementations from
logical_expr/mod.rstological_expr/ast_conversion.rs(525 lines) - Added new helper modules:
visitors.rs,combinators.rs, andbuilder.rswith comprehensive tests
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/query_planner/plan_ctx/table_ctx.rs | New module containing TableCtx struct with well-organized methods and documentation |
| src/query_planner/plan_ctx/mod.rs | Removed TableCtx implementation, added re-export for backward compatibility |
| src/query_planner/plan_ctx/builder.rs | New builder pattern implementation for PlanCtx with fluent API and tests |
| src/query_planner/logical_expr/visitors.rs | New visitor pattern implementation for expression traversal with helper visitors |
| src/query_planner/logical_expr/combinators.rs | New predicate combinator functions for combining boolean expressions |
| src/query_planner/logical_expr/ast_conversion.rs | Extracted AST conversion implementations with improved logging (println → log::trace) |
| src/query_planner/logical_expr/mod.rs | Reduced from 1404 to 947 lines by extracting conversions and adding module declarations |
| src/query_planner/analyzer/graph_join_inference.rs | Updated to use new new_with_cte_reference API that breaks circular dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
…rate modules
Code quality improvements to bring modules to Grade A level:
logical_expr/mod.rs (1404 → 947 lines, -33%):
plan_ctx/mod.rs (1391 → 1160 lines, -17%):
Files added:
All 832 tests passing (single-threaded; pre-existing flaky test in parallel mode)