-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
planner: add a hint for CTE #34574
planner: add a hint for CTE #34574
Conversation
I want to insert a hint for CTE-inline, but the Optimizer doesn't find the hint which I code.
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/8089e5186b8b4188dab0b133a3daebca27084707 |
only insert some var
these is no unit test, I will finish it today. |
parser/parser_test.go
Outdated
@@ -4192,6 +4192,16 @@ func TestOptimizerHints(t *testing.T) { | |||
require.Len(t, hints, 2) | |||
require.Equal(t, "limit_to_cop", hints[0].HintName.L) | |||
require.Equal(t, "limit_to_cop", hints[1].HintName.L) | |||
|
|||
// Test CTE_INLINE | |||
stmt, _, err = p.Parse("with cte(x) as (select /*+ CTE_INLINE(), cte_inline() */ * from t1) select * from cte;", "", "") |
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.
If there is multiple CTEs, do we need to write hint for each CTE to get every CTE inlined?
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.
At present, I intend to add hint in each CTE, because hint is added after each “select”. If there is a better way, I will add it later.
I fix my mistake , and remake the hintparser.y
comment on exported type CTEHintInfo should be of the form "CTEHintInfo ..." (with optional leading
fix merge conflict.
/run-unit-test |
/run-unit-test |
/run-check_dev_2 |
/run-check_dev_2 |
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.
Any tiflash tests?
we will code tiflash tests on automated-tests |
@wjhuang2016 PTAL again |
@dayicklp: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2dc8025
|
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #17472
Problem Summary: Insert a hint for CTE, which can control the merge function in CTE
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.