-
Notifications
You must be signed in to change notification settings - Fork 11
Set parsed comments in operator for subqueries (#18369) #174
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
Conversation
Signed-off-by: David Piegza <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements proper comment preservation when merging subqueries with outer queries in Vitess's query planner. The change ensures that SQL comments from the original query are retained in the merged operator when subqueries are consolidated into a single route.
Key changes:
- Added logic to preserve comments when merging subqueries with outer queries
- Added test cases to verify comment preservation in both merged and non-merged subquery scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
go/vt/vtgate/planbuilder/operators/subquery_planning.go | Added comment preservation logic in the subquery merge function |
go/vt/vtgate/planbuilder/testdata/select_cases.json | Added test cases for comment handling with subqueries |
"user.user" | ||
] | ||
}, | ||
"skip_e2e": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This skip_e2e
attribute does not exist on v21 yet, so you might have to remove this here and in the other test case. This is causing the unit test failure:
--- FAIL: TestPlanTestSuite/TestPlan/select_cases.json (0.00s)
panic: json: unknown field "skip_e2e" [recovered]
panic: json: unknown field "skip_e2e"
goroutine 1042 [running]:
testing.tRunner.func1.2({0x16b53c0, 0xc00074a6f0})
/opt/hostedtoolcache/go/1.22.12/x64/src/testing/testing.go:1631 +0x24a
testing.tRunner.func1()
/opt/hostedtoolcache/go/1.22.12/x64/src/testing/testing.go:1634 +0x377
panic({0x16b53c0?, 0xc00074a6f0?})
/opt/hostedtoolcache/go/1.22.12/x64/src/runtime/panic.go:770 +0x132
vitess.io/vitess/go/vt/vtgate/planbuilder.readJSONTests({0x18f7525, 0x11})
/home/runner/work/vitess-gh/vitess-gh/go/vt/vtgate/planbuilder/plan_test.go:724 +0xf0
vitess.io/vitess/go/vt/vtgate/planbuilder.(*planTestSuite).testFile.func1(0xc0007731e0)
/home/runner/work/vitess-gh/vitess-gh/go/vt/vtgate/planbuilder/plan_test.go:658 +0x8d
testing.tRunner(0xc0007731e0, 0xc000760200)
/opt/hostedtoolcache/go/1.22.12/x64/src/testing/testing.go:1689 +0xfb
created by testing.(*T).Run in goroutine 250
/opt/hostedtoolcache/go/1.22.12/x64/src/testing/testing.go:1742 +0x390
FAIL vitess.io/vitess/go/vt/vtgate/planbuilder 1.095s
Signed-off-by: Mohamed Hamza <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
Fix formatting for table entries in select_cases.json
Signed-off-by: Mohamed Hamza <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
This is a backport of vitessio#18369
Description
Related Issue(s)
Checklist
Deployment Notes