Skip to content

Commit

Permalink
expression: push down left/right/abs to tiflash (#25018)
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhedu authored Jun 4, 2021
1 parent 5a74d52 commit 99b1fa5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions expression/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -999,16 +999,19 @@ func scalarExprSupportedByFlash(function *ScalarFunction) bool {
case
ast.LogicOr, ast.LogicAnd, ast.UnaryNot, ast.BitNeg, ast.Xor, ast.And, ast.Or,
ast.GE, ast.LE, ast.EQ, ast.NE, ast.LT, ast.GT, ast.In, ast.IsNull, ast.Like,
ast.Plus, ast.Minus, ast.Div, ast.Mul, /*ast.Mod,*/
ast.Plus, ast.Minus, ast.Div, ast.Mul, ast.Abs, /*ast.Mod,*/
ast.If, ast.Ifnull, ast.Case,
ast.Concat, ast.ConcatWS,
ast.Year, ast.Month, ast.Day,
ast.DateDiff, ast.TimestampDiff, ast.DateFormat, ast.FromUnixTime,
ast.JSONLength:
return true
case ast.Substr, ast.Substring:
case ast.Substr, ast.Substring, ast.Left, ast.Right, ast.CharLength:
switch function.Function.PbCode() {
case
tipb.ScalarFuncSig_LeftUTF8,
tipb.ScalarFuncSig_RightUTF8,
tipb.ScalarFuncSig_CharLengthUTF8,
tipb.ScalarFuncSig_Substring2ArgsUTF8,
tipb.ScalarFuncSig_Substring3ArgsUTF8:
return true
Expand Down

0 comments on commit 99b1fa5

Please sign in to comment.