From ff1aa5e70662ba6c3e3977af8a4448a3abc9ae18 Mon Sep 17 00:00:00 2001 From: tangwz Date: Mon, 23 Sep 2019 21:57:07 +0800 Subject: [PATCH] expression: implement vectorized evaluation for builtinRoundWithFracIntSig (#12103) --- expression/builtin_math_vec.go | 3 +++ expression/builtin_math_vec_test.go | 1 + 2 files changed, 4 insertions(+) diff --git a/expression/builtin_math_vec.go b/expression/builtin_math_vec.go index 06e478794a341..b53593e52d4d0 100644 --- a/expression/builtin_math_vec.go +++ b/expression/builtin_math_vec.go @@ -474,6 +474,9 @@ func (b *builtinRoundIntSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column } func (b *builtinRoundIntSig) vectorized() bool { + return true +} + func (b *builtinRoundWithFracIntSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error { if err := b.args[0].VecEvalInt(b.ctx, input, result); err != nil { return err diff --git a/expression/builtin_math_vec_test.go b/expression/builtin_math_vec_test.go index 0c117f1dfaa53..04ba5e9bcbec9 100644 --- a/expression/builtin_math_vec_test.go +++ b/expression/builtin_math_vec_test.go @@ -75,6 +75,7 @@ var vecBuiltinMathCases = map[string][]vecExprBenchCase{ ast.Round: { {retEvalType: types.ETDecimal, childrenTypes: []types.EvalType{types.ETDecimal}}, {retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETInt}}, + {retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETInt, types.ETInt}, geners: []dataGenerator{nil, &rangeInt64Gener{-100, 100}}}, }, ast.Pow: { {retEvalType: types.ETReal, childrenTypes: []types.EvalType{types.ETReal, types.ETReal}, geners: []dataGenerator{&rangeRealGener{0, 10, 0.5}, &rangeRealGener{0, 100, 0.5}}},