Skip to content

Commit

Permalink
expression: support quarter pushdown to tiflash (pingcap#30704)
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 authored Dec 28, 2021
1 parent 3ea7a1d commit 22cad97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions expression/expr_to_pb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,11 @@ func TestExprPushDownToFlash(t *testing.T) {
require.NoError(t, err)
exprs = append(exprs, function)

// quarter: supported
function, err = NewFunction(mock.NewContext(), ast.Quarter, types.NewFieldType(mysql.TypeLonglong), datetimeColumn)
require.NoError(t, err)
exprs = append(exprs, function)

pushed, remained = PushDownExprs(sc, exprs, client, kv.TiFlash)
require.Len(t, pushed, len(exprs))
require.Len(t, remained, 0)
Expand Down
2 changes: 1 addition & 1 deletion expression/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ func scalarExprSupportedByFlash(function *ScalarFunction) bool {
ast.Plus, ast.Minus, ast.Div, ast.Mul, ast.Abs, ast.Mod,
ast.If, ast.Ifnull, ast.Case,
ast.Concat, ast.ConcatWS,
ast.Date, ast.Year, ast.Month, ast.Day,
ast.Date, ast.Year, ast.Month, ast.Day, ast.Quarter,
ast.DateDiff, ast.TimestampDiff, ast.DateFormat, ast.FromUnixTime,

ast.Sqrt, ast.Log, ast.Log2, ast.Log10, ast.Ln, ast.Exp, ast.Pow, ast.Sign,
Expand Down

0 comments on commit 22cad97

Please sign in to comment.