Skip to content
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

Extract a common error message pattern for conflicted SQL hints and hint alias #11632

Open
foreyes opened this issue Aug 6, 2019 · 1 comment
Assignees
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@foreyes
Copy link
Contributor

foreyes commented Aug 6, 2019

Feature Request

Is your feature request related to a problem? Please describe:

When adding new optimizer hints #11364 , we have these warnings messages:
"Optimizer aggregation hints are conflicted" for TIDB_HASHAGG and TIDB_STREAMAGG.
"Join hints are conflict, you can only specify one type of join" for Join Hints.

Describe the feature you'd like:

Extract a common error message pattern for conflicted SQL hints, for example:

errMsgPattern := "Conflicted SQL Hints for %s. You can only specify one of these hints: %s"
errConflictedSQLHints := terror.ClassOptimizer.New(codeInternal, errMsgPattern)
errConflictedSQLHints.GenWithStackByArgs(
	"Aggregate",
	strings.Join([]string{"TIDB_HASHAGG()", "TIDB_STREAMAGG()"}, ","),
)
errConflictedSQLHints.GenWithStackByArgs(
	"Join",
	strings.Join([]string{"TIDB_HJ()", "TIDB_SMJ()", "TIDB_INLJ()"}, ","),
)

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

@foreyes foreyes added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Aug 6, 2019
@foreyes foreyes self-assigned this Aug 6, 2019
@foreyes
Copy link
Contributor Author

foreyes commented Aug 13, 2019

Maybe we need take Hint Alias into considering too.

@foreyes foreyes changed the title Extract a common error message pattern for conflicted SQL hints Extract a common error message pattern for conflicted SQL hints and hint Aug 13, 2019
@foreyes foreyes changed the title Extract a common error message pattern for conflicted SQL hints and hint Extract a common error message pattern for conflicted SQL hints and hint alias Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant