Skip to content

Commit

Permalink
expression: implement vectorized evaluation for builtinRoundWithFracI…
Browse files Browse the repository at this point in the history
…ntSig (pingcap#12103)
  • Loading branch information
tangwz committed Sep 23, 2019
1 parent 50bd8e9 commit ff1aa5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions expression/builtin_math_vec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions expression/builtin_math_vec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}},
Expand Down

0 comments on commit ff1aa5e

Please sign in to comment.