vtexplain get query result types from schema#3266
Closed
demmer wants to merge 6 commits intovitessio:masterfrom
Closed
vtexplain get query result types from schema#3266demmer wants to merge 6 commits intovitessio:masterfrom
demmer wants to merge 6 commits intovitessio:masterfrom
Conversation
Previously, when returning results from queries, vtexplain used the default SingleRowResult that was used in the various tablet tests and as such had a fixed schema of two fields. This caused confusing results for queries involving econdary indexes as the results are used as part of the plan generation. Instead, rework the implementation so that instead it tries to parse the query sent to the fake mysql and in the cases of simple select expressions, uses the knowledge of the table schema to produce Result objects with the correct types and synthetic values. As part of this work, replace the QueryLogger hook in fakesqldb with a more generic hook that enables overriding the query handler.
Modify the fake healthcheck module to allow other types of fake connections to be created in addition to SandboxConn. Remove the Executor interface from SandboxConn. Both of these pave the way for reworking how vtexplain is plumbed to avoid using SandboxConn at all and instead just implement the QueryService interface directly.
The previous method of hijacking the SandboxConn didn't properly execute all of the logic for transactions and instead relied on autocommit behavior at the tablet. Instead, implement the QueryService directly and route the calls to the tabletserver implementation. This does a better job of emulating the actual vtgate transaction flow and opens up the opportunity to demonstrate other things such as 2PC.
855909c to
7e3cc1f
Compare
Member
Author
|
Will rework in light of #3265 |
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.
NOT YET FOR MERGE: Depends on changes in #3264 and #3265.
Previously, when returning results from queries, vtexplain used the default SingleRowResult that was used in the various tablet tests and as such had a fixed schema of two fields. This caused confusing results for queries involving secondary indexes as the results are used as part of the plan generation.
Instead, rework the implementation so that it tries to parse the query sent to the fake mysql and in the cases of simple select expressions, uses the knowledge of the table schema to produce Result objects with the correct types and synthetic values.
As part of this work, replace the QueryLogger hook in fakesqldb with a more generic hook that enables overriding the query handler.