expression: implement vectorized evaluation for 'builtinBitAndSig' (#12612)
This commit is contained in:
committed by
Yuanjia Zhang
parent
fbf0d90c06
commit
95d133a60f
@ -370,11 +370,29 @@ func (b *builtinLogicXorSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column
|
||||
}
|
||||
|
||||
func (b *builtinBitAndSig) vectorized() bool {
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
func (b *builtinBitAndSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error {
|
||||
return errors.Errorf("not implemented")
|
||||
if err := b.args[0].VecEvalInt(b.ctx, input, result); err != nil {
|
||||
return err
|
||||
}
|
||||
numRows := input.NumRows()
|
||||
buf, err := b.bufAllocator.get(types.ETInt, numRows)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer b.bufAllocator.put(buf)
|
||||
if err := b.args[1].VecEvalInt(b.ctx, input, buf); err != nil {
|
||||
return err
|
||||
}
|
||||
arg0s := result.Int64s()
|
||||
arg1s := buf.Int64s()
|
||||
result.MergeNulls(buf)
|
||||
for i := 0; i < numRows; i++ {
|
||||
arg0s[i] &= arg1s[i]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *builtinRealIsFalseSig) vectorized() bool {
|
||||
|
||||
@ -50,6 +50,9 @@ var vecBuiltinOpCases = map[string][]vecExprBenchCase{
|
||||
{retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETDecimal}},
|
||||
{retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETInt}},
|
||||
},
|
||||
ast.And: {
|
||||
{retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETInt, types.ETInt}, geners: makeBinaryLogicOpDataGeners()},
|
||||
},
|
||||
ast.UnaryMinus: {},
|
||||
ast.IsNull: {
|
||||
{retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETReal}},
|
||||
|
||||
Reference in New Issue
Block a user