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

expression: Support push function replace down to TiFlash #25084

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions expression/expr_to_pb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,11 @@ func (s *testEvaluatorSuite) TestExprPushDownToFlash(c *C) {
c.Assert(err, IsNil)
exprs = append(exprs, function)

// Replace
function, err = NewFunction(mock.NewContext(), ast.Replace, types.NewFieldType(mysql.TypeString), stringColumn, stringColumn, stringColumn)
c.Assert(err, IsNil)
exprs = append(exprs, function)

function, err = NewFunction(mock.NewContext(), ast.Round, types.NewFieldType(mysql.TypeDouble), realColumn)
c.Assert(err, IsNil)
exprs = append(exprs, function)
Expand Down
5 changes: 5 additions & 0 deletions expression/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,11 @@ func scalarExprSupportedByFlash(function *ScalarFunction) bool {
case tipb.ScalarFuncSig_ExtractDatetime:
return true
}
case ast.Replace:
switch function.Function.PbCode() {
case tipb.ScalarFuncSig_Replace:
return true
}
}
return false
}
Expand Down