Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression: implement vectorized evaluation for builtinPowSig #12242

Merged
merged 11 commits into from
Sep 18, 2019
Prev Previous commit
Next Next commit
replace buf2 with result
  • Loading branch information
Hokkaitao committed Sep 18, 2019
commit 83e02d58598249f33cb478f7e12a6c064eb6795a
13 changes: 4 additions & 9 deletions expression/builtin_math_vec.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,15 @@ func (b *builtinPowSig) vecEvalReal(input *chunk.Chunk, result *chunk.Column) er
return err
}

buf2, err := b.bufAllocator.get(types.ETReal, n)
if err != nil {
return err
}
defer b.bufAllocator.put(buf2)
if err := b.args[1].VecEvalReal(b.ctx, input, buf2); err != nil {
if err := b.args[1].VecEvalReal(b.ctx, input, result); err != nil {
return err
}

x := buf1.Float64s()
y := buf2.Float64s()
result.ResizeFloat64(n, false)
y := result.Float64s()
f64s := result.Float64s()
for i := 0; i < n; i++ {
if buf1.IsNull(i) || buf2.IsNull(i) {
if buf1.IsNull(i) || result.IsNull(i) {
result.SetNull(i, true)
continue
}
Expand Down