-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
expr: add switch to control pushing bit column down #32795
Conversation
Signed-off-by: yisaer <[email protected]>
[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/6dc835d15c67e82b815e0cb436de0bdb85596700 |
expression/expr_to_pb.go
Outdated
@@ -182,6 +182,10 @@ func (pc PbConverter) columnToPBExpr(column *Column) *tipb.Expr { | |||
return nil | |||
} | |||
switch column.GetType().Tp { | |||
case mysql.TypeBit: | |||
if !IsPushDownEnabled("bit", kv.TiKV) { |
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.
will this affect tiflash?
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.
No,The bit column won't be push down to tiflash due to following codes:
Lines 1275 to 1285 in 493eb45
func canExprPushDown(expr Expression, pc PbConverter, storeType kv.StoreType, canEnumPush bool) bool { | |
if storeType == kv.TiFlash { | |
switch expr.GetType().Tp { | |
case mysql.TypeEnum, mysql.TypeBit, mysql.TypeSet, mysql.TypeGeometry, mysql.TypeUnspecified: | |
if expr.GetType().Tp == mysql.TypeEnum && canEnumPush { | |
break | |
} | |
if pc.sc.InExplainStmt { | |
pc.sc.AppendWarning(errors.New("Expression about '" + expr.String() + "' can not be pushed to TiFlash because it contains unsupported calculation of type '" + types.TypeStr(expr.GetType().Tp) + "'.")) | |
} | |
return false |
Signed-off-by: yisaer <[email protected]>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 6dc835d
|
Signed-off-by: yisaer [email protected]
What problem does this PR solve?
Issue Number: ref #30738
Problem Summary:
What is changed and how it works?
add switch to control pushing bit column down
Check List
Tests
Release note