From a4ce627529ba529d8825876cb5773a8972bfbc0f Mon Sep 17 00:00:00 2001 From: tsthght <781181214@qq.com> Date: Thu, 17 Oct 2019 19:39:48 +0800 Subject: [PATCH] expression: implement vectorized evaluation for 'builtinCastJSONAsJSONSig' (#12794) --- expression/builtin_cast_vec.go | 4 ++-- expression/builtin_cast_vec_test.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/expression/builtin_cast_vec.go b/expression/builtin_cast_vec.go index dc77da13181fb..2e8f7a87bbfb2 100644 --- a/expression/builtin_cast_vec.go +++ b/expression/builtin_cast_vec.go @@ -582,11 +582,11 @@ func (b *builtinCastIntAsJSONSig) vecEvalJSON(input *chunk.Chunk, result *chunk. } func (b *builtinCastJSONAsJSONSig) vectorized() bool { - return false + return true } func (b *builtinCastJSONAsJSONSig) vecEvalJSON(input *chunk.Chunk, result *chunk.Column) error { - return errors.Errorf("not implemented") + return b.args[0].VecEvalJSON(b.ctx, input, result) } func (b *builtinCastJSONAsStringSig) vectorized() bool { diff --git a/expression/builtin_cast_vec_test.go b/expression/builtin_cast_vec_test.go index 83718df96cc7e..484c4dccdc604 100644 --- a/expression/builtin_cast_vec_test.go +++ b/expression/builtin_cast_vec_test.go @@ -50,6 +50,7 @@ var vecBuiltinCastCases = map[string][]vecExprBenchCase{ {retEvalType: types.ETDuration, childrenTypes: []types.EvalType{types.ETDuration}}, {retEvalType: types.ETJson, childrenTypes: []types.EvalType{types.ETInt}}, {retEvalType: types.ETJson, childrenTypes: []types.EvalType{types.ETReal}}, + {retEvalType: types.ETJson, childrenTypes: []types.EvalType{types.ETJson}}, }, }