expression: implement vectorized evaluation for builtinRealIsFalseSig (#12527)
This commit is contained in:
committed by
Yuanjia Zhang
parent
bf10a7a494
commit
be6163c823
@ -325,11 +325,31 @@ func (b *builtinBitAndSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column)
|
||||
}
|
||||
|
||||
func (b *builtinRealIsFalseSig) vectorized() bool {
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
func (b *builtinRealIsFalseSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error {
|
||||
return errors.Errorf("not implemented")
|
||||
numRows := input.NumRows()
|
||||
buf, err := b.bufAllocator.get(types.ETReal, numRows)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer b.bufAllocator.put(buf)
|
||||
if err := b.args[0].VecEvalReal(b.ctx, input, buf); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result.ResizeInt64(numRows, false)
|
||||
i64s := result.Int64s()
|
||||
bufI64s := buf.Int64s()
|
||||
for i := 0; i < numRows; i++ {
|
||||
if buf.IsNull(i) || bufI64s[i] != 0 {
|
||||
i64s[i] = 0
|
||||
} else {
|
||||
i64s[i] = 1
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *builtinUnaryMinusIntSig) vectorized() bool {
|
||||
|
||||
@ -27,6 +27,7 @@ var vecBuiltinOpCases = map[string][]vecExprBenchCase{
|
||||
{retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETDecimal}, geners: []dataGenerator{&defaultGener{0.2, types.ETDecimal}}},
|
||||
},
|
||||
ast.IsFalsity: {
|
||||
{retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETReal}},
|
||||
{retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETDecimal}},
|
||||
},
|
||||
ast.LogicOr: {
|
||||
|
||||
Reference in New Issue
Block a user