Skip to content

Commit

Permalink
expression: implement vectorized evaluation for builtinVersionSig (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
TennyZhuang authored and sre-bot committed Nov 5, 2019
1 parent 5fd8b4d commit 44696bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions expression/builtin_info_vec.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package expression

import (
"github.com/pingcap/errors"
"github.com/pingcap/parser/mysql"
"github.com/pingcap/tidb/util/chunk"
"github.com/pingcap/tidb/util/printer"
)
Expand Down Expand Up @@ -154,11 +155,16 @@ func (b *builtinLastInsertIDWithIDSig) vecEvalInt(input *chunk.Chunk, result *ch
}

func (b *builtinVersionSig) vectorized() bool {
return false
return true
}

func (b *builtinVersionSig) vecEvalString(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
n := input.NumRows()
result.ReserveString(n)
for i := 0; i < n; i++ {
result.AppendString(mysql.ServerVersion)
}
return nil
}

func (b *builtinTiDBDecodeKeySig) vectorized() bool {
Expand Down
3 changes: 3 additions & 0 deletions expression/builtin_info_vec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import (
)

var vecBuiltinInfoCases = map[string][]vecExprBenchCase{
ast.Version: {
{retEvalType: types.ETString, childrenTypes: []types.EvalType{}},
},
ast.TiDBVersion: {
{retEvalType: types.ETString, childrenTypes: []types.EvalType{}},
},
Expand Down

0 comments on commit 44696bf

Please sign in to comment.