refactor(query_engine_context): remove rw result from context field - #1418
Draft
jkaczman wants to merge 2 commits into
Draft
refactor(query_engine_context): remove rw result from context field#1418jkaczman wants to merge 2 commits into
jkaczman wants to merge 2 commits into
Conversation
Starting to restructure RewriteResult to become a "Query Planner"; As part of our goal to support more "multi-query" queries such as subselects and CTEs, as well as supporting better EXPLAIN output, we need an intermediate step between parsing and execution that creates a proper "Query Plan". After going through the code and poking it a few different ways, we determined that the best place to live is what is currently called RewriteResult, and what we expect to eventually call `QueryPlanner`. Our long term goal is to have this take the query engine context as an argument, and return the abstract steps required, those steps being the query to be run (with subqueries replaced with placeholders), and the route it is going to be run on. As we're promoting this to a "thing that does the thing", it no longer makes conceptual sense to have it live on QueryEngineContext, as it's not context. Additionally, we intend to eventually have this start to hold onto borrowed data, and adding an additional lifetime to QueryEngineContext will affect much more code than what is necessary for this refactor.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
sgrif
marked this pull request as draft
August 24, 2026 17:59
Collaborator
|
Might also want to look at combining it with |
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.
Starting to restructure RewriteResult to become a "Query Planner";
As part of our goal to support more "multi-query" queries such as subselects and CTEs, as well as supporting better EXPLAIN output, we need an intermediate step between parsing and execution that creates a proper "Query Plan".
After going through the code and poking it a few different ways, we determined that the best place to live is what is currently called RewriteResult, and what we expect to eventually call
QueryPlanner. Our long term goal is to have this take the query engine context as an argument, and return the abstract steps required, those steps being the query to be run (with subqueries replaced with placeholders), and the route it is going to be run on.As we're promoting this to a "thing that does the thing", it no longer makes conceptual sense to have it live on QueryEngineContext, as it's not context. Additionally, we intend to eventually have this start to hold onto borrowed data, and adding an additional lifetime to QueryEngineContext will affect much more code than what is necessary for this refactor.
Co-authored-by: Sage <sagetheprogrammer.com>